Problem: On the way to school, Karen became fixated on the puzzle game on her phone!

<image>

The game is played as follows. In each level, you have a grid with n rows and m columns. Each cell originally contains the number 0.

One move consists of choosing one row or column, and adding 1 to all of the cells in that row or column.

To win the level, after all the moves, the number in the cell at the i-th row and j-th column should be equal to gi, j.

Karen is stuck on one level, and wants to know a way to beat this level using the minimum number of moves. Please, help her with this task!

Input

The first line of input contains two integers, n and m (1 ≤ n, m ≤ 100), the number of rows and the number of columns in the grid, respectively.

The next n lines each contain m integers. In particular, the j-th integer in the i-th of these rows contains gi, j (0 ≤ gi, j ≤ 500).

Output

If there is an error and it is actually not possible to beat the level, output a single integer -1.

Otherwise, on the first line, output a single integer k, the minimum number of moves necessary to beat the level.

The next k lines should each contain one of the following, describing the moves in the order they must be done:

  * row x, (1 ≤ x ≤ n) describing a move of the form "choose the x-th row". 
  * col x, (1 ≤ x ≤ m) describing a move of the form "choose the x-th column". 



If there are multiple optimal solutions, output any one of them.

Examples

Input

3 5
2 2 2 3 2
0 0 0 1 0
1 1 1 2 1


Output

4
row 1
row 1
col 4
row 3


Input

3 3
0 0 0
0 1 0
0 0 0


Output

-1


Input

3 3
1 1 1
1 1 1
1 1 1


Output

3
row 1
row 2
row 3

Note

In the first test case, Karen has a grid with 3 rows and 5 columns. She can perform the following 4 moves to beat the level:

<image>

In the second test case, Karen has a grid with 3 rows and 3 columns. It is clear that it is impossible to beat the level; performing any move will create three 1s on the grid, but it is required to only have one 1 in the center.

In the third test case, Karen has a grid with 3 rows and 3 columns. She can perform the following 3 moves to beat the level:

<image>

Note that this is not the only solution; another solution, among others, is col 1, col 2, col 3.

Solution (in JAVA):

Solution:
import java.util.*;
import java.io.*;
import java.math.*;
public class CF816C {
public static void main(String args[]) {

	String name = "input";
	String path = "/media/remedy441/Study/Codes/Java/InputOutput/";
	Locale.setDefault(Locale.US);
	//FileInputStream fileIn = new FileInputStream(path + name + ".in");
	//File fileOut = new File(path + name + ".out");

	//InputReader in = new InputReader(fileIn);
	//PrintWriter out = new PrintWriter(path + name + ".out");

	InputReader in = new InputReader(System.in);
	PrintWriter out = new PrintWriter(System.out);

	//My Code Starts Here
	int n=in.nextInt();
	int m=in.nextInt();
	
	int ar[][]=new int [n][m];
	int ar1[][]=new int [n][m];
	int row[]=new int[n];
	int row1[]=new int[n];
	int col[]=new int[m];
	int col1[]=new int[m];
	for(int i=0;i<n;i++){
		row[i]=Integer.MAX_VALUE;
		row1[i]=Integer.MAX_VALUE;
	}
	for(int j=0;j<m;j++){
		col[j]=Integer.MAX_VALUE;
		col1[j]=Integer.MAX_VALUE;
	}
	int cnt=0;
	int cnt1=0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			ar[i][j]=in.nextInt();
			ar1[i][j]=ar[i][j];
			row[i]=Math.min(row[i], ar[i][j]);
			col1[j]=Math.min(col1[j], ar1[i][j]);
			
			
		}
	}
	for(int i=0;i<n;i++)
	{
		if(row[i]>0){
			cnt=cnt+row[i];
		}
		for(int j=0;j<m;j++)
		{
			ar[i][j]=ar[i][j]-row[i];
			col[j]=Math.min(col[j], ar[i][j]);
			
			
		}
	}
	for(int j=0;j<m;j++)
	{
		if(col1[j]>0){
			cnt1=cnt1+col1[j];
		}
		for(int i=0;i<n;i++)
		{
			ar1[i][j]=ar1[i][j]-col1[j];
			row1[i]=Math.min(row1[i], ar1[i][j]);
			
		}
	}
	for(int i=0;i<m;i++)
	{
		if(col[i]>0){
			cnt=cnt+col[i];
		}
	}
	for(int i=0;i<n;i++)
	{
		if(row1[i]>0){
			cnt1=cnt1+row1[i];
		}
	}
	
	boolean flag = true;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			ar[i][j]=ar[i][j]-col[j];
			
			if(ar[i][j]!=0){
				flag=false;
				break;
			}
			
		}
		if(!flag)
			break;
	}
	boolean flag1 = true;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			ar1[i][j]=ar1[i][j]-row1[i];
			
			if(ar[i][j]!=0){
				flag1=false;
				break;
			}
			
		}
		if(!flag1)
			break;
	}
	
	if(flag&&flag1){
		if(cnt<cnt1)
		{
			out.println(cnt);
			for(int i=0;i<n;i++)
			{
				if(row[i]>0)
				{
					for(int x=0;x<row[i];x++)
						out.println("row "+(i+1));
				}
			}
			for(int j=0;j<m;j++)
			{
				if(col[j]>0)
				{
					for(int x=0;x<col[j];x++)
						out.println("col "+(j+1));
				}
			}
		}
		else
		{
			out.println(cnt1);
			for(int i=0;i<n;i++)
			{
				if(row1[i]>0)
				{
					for(int x=0;x<row1[i];x++)
						out.println("row "+(i+1));
				}
			}
			for(int j=0;j<m;j++)
			{
				if(col1[j]>0)
				{
					for(int x=0;x<col1[j];x++)
						out.println("col "+(j+1));
				}
			}
		}
	}
	else
		out.print(-1);
	//EndsHere

	out.close();

}

int sieveOfEratosthenes(int n) {
	// Create a boolean array "prime[0..n]" and initialize
	// all entries it as true. A value in prime[i] will
	// finally be false if i is Not a prime, else true.
	boolean prime[] = new boolean[n + 1];
	for (int i = 0; i <= n; i++)
		prime[i] = true;

	for (int p = 2; p * p <= n; p++) {
		// If prime[p] is not changed, then it is a prime
		if (prime[p] == true) {
			// Update all multiples of p
			for (int i = p * 2; i <= n; i += p)
				prime[i] = false;
		}
	}
	int c = 0;
	for (int i = 2; i <= n; i++) {
		if (prime[i] == true)
			c++;
	}
	return c;
	// Print all prime numbers
	/* for(int i = 2; i <= n; i++)
	 {
	     if(prime[i] == true)
	         System.out.print(i + " ");
	 }*/
}

static class Pair implements Comparable<Pair> {
	int u;
	int v;
	BigInteger bi;

	public Pair(int u, int v) {
		this.u = u;
		this.v = v;
	}

	public int hashCode() {
		int hu = (int) (u ^ (u >>> 32));
		int hv = (int) (v ^ (v >>> 32));
		return 31 * hu + hv;
	}

	public boolean equals(Object o) {
		Pair other = (Pair) o;
		return u == other.u && v == other.v;
	}

	public int compareTo(Pair other) {
		return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
	}

	public String toString() {
		return "[u=" + u + ", v=" + v + "]";
	}
}

static long modulo(long a, long b, long c) {
	long x = 1;
	long y = a;
	while (b > 0) {
		if (b % 2 == 1) {
			x = (x * y) % c;
		}
		y = (y * y) % c; // squaring the base
		b /= 2;
	}
	return x % c;
}

long factorial(long n, long M) {
	long ans = 1;
	while (n >= 1) {
		ans = (ans * n) % M;
		n--;
	}
	return ans;
}

static long gcd(long x, long y) {
	if (x == 0)
		return y;
	if (y == 0)
		return x;
	long r = 0, a, b;
	a = (x > y) ? x : y; // a is greater number
	b = (x < y) ? x : y; // b is smaller number
	r = b;
	while (a % b != 0) {
		r = a % b;
		a = b;
		b = r;
	}
	return r;
}

static class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream inputstream) {
		reader = new BufferedReader(new InputStreamReader(inputstream));
		tokenizer = null;
	}

	public String nextLine() {
		String fullLine = null;
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				fullLine = reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			return fullLine;
		}
		return fullLine;
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}
}
}