#874. Half Mixed

Half Mixed

Background

Given two integers nn and mm, you need to construct a matrix MM satisfying the following constraints:

  • The number of rows and columns of MM are nn and mm respectively.

  • The matrix contains only 0s and 1s, namely, Mi,j0,1forall1inand1jm.M_{i,j} ∈ 0, 1 for all 1 ≤ i ≤ n and 1 ≤ j ≤ m.

  • The number of mixed subrectangles equal to the number of pure subrectangles. The subrectangles containing   both 00s and 11s are considered mixed subrectangles, otherwise pristine subrectangles. Note that a subrectangle   intersects some consecutive rows and some consecutive columns.

Now contestants have submitted many matrices, you need to check if they are right or not.

Input

The first line contains two integers nn and m(1n,m106,1n×m106)m (1 ≤ n, m ≤ 10^6, 1 ≤ n × m ≤ 10^6), denoting the number of rows and columns respectively.

Then next n lines, each line has m digits denoting the matrix. .

Output

Print 33 integers in one line, denoting the number of mixed subrectangles, pure 00s subrectangles, pure 11s subrectangles.

Samples

2 3
0 1 1
1 1 0
9 2 7