You are given a matrix A of size M * N, where 0 ≤ Aij < K. The rows are numbered from 1 to M, the columns are numbered from 1 to N.
You are allowed to apply 2 types of operations:
The first line contains three integers, M, N and K, (1 ≤ M, N ≤ 1000, 1 ≤ K ≤ 109).
The following M lines describe the matrix. Each line consists of N numbers Aij (0 ≤ Aij < K).
The minimal number of operations is displayed in the first line.
In the following line you should output M numbers describing how many operations were applied for each row (starting from the first row).
In the following line you should output N numbers describing how many operations were applied for each column (starting from the first column).
3 3 2
0 0 0
1 1 1
1 1 1
2
0 1 1
0 0 0