import java.io.*;
import java.util.*;

public class supreme_va implements Runnable {
	public static void main(String[] args) {
		new Thread(new supreme_va()).run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}

		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();

		int[][] c = new int[n][m];

		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[i].length; j++) {
				c[i][j] = nextInt();
			}
		}

		HashSet<Integer> colors = new HashSet<Integer>();

		for (int i = 0; i < c.length; i++) {
			HashMap<Integer, Integer> hs = new HashMap<Integer, Integer>();
			for (int j = 0; j < c[0].length; j++) {
				if (!hs.containsKey(c[i][j])) {
					hs.put(c[i][j], 0);
				}
				hs.put(c[i][j], hs.get(c[i][j]) + 1);
			}
			for (int cc : hs.keySet()) {
				if (hs.get(cc) > m / 2)
					colors.add(cc);
			}
		}

		for (int i = 0; i < c[0].length; i++) {
			HashMap<Integer, Integer> hs = new HashMap<Integer, Integer>();
			for (int j = 0; j < c.length; j++) {
				if (!hs.containsKey(c[j][i])) {
					hs.put(c[j][i], 0);
				}
				hs.put(c[j][i], hs.get(c[j][i]) + 1);
			}
			for (int cc : hs.keySet()) {
				if (hs.get(cc) > n / 2)
					colors.add(cc);
			}
		}

		next: for (int color : colors) {
			System.err.println(color);
			int[][] c2 = new int[n + 1][m + 1];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					c2[i + 1][j + 1] = c[i][j];
					if (c[i][j] == color) {
						c2[i + 1][0]++;
						c2[0][j + 1]++;
					}
				}
			}
			boolean good = true;
			ArrayList<String> answer = new ArrayList<String>();
			while (good) {
				good = false;
				int nx = -1;
				int ny = -1;
				int dx = 0;
				int dy = 0;
				String action = "";
				for (int i = 1; i < n + 1; i++) {
					if (c2[i][0] < m) {
						good = true;
						if (c2[i][0] > m / 2) {
							nx = i;
							ny = 1;
							dx = 0;
							dy = 1;
							action = "R " + nx;
						}
					}
				}

				for (int i = 1; i < m + 1; i++) {
					if (c2[0][i] < n) {
						good = true;

						if (c2[0][i] > n / 2) {
							nx = 1;
							ny = i;
							dx = 1;
							dy = 0;
							action = "C " + ny;
						}
					}
				}

				if (good && nx == -1 && ny == -1)
					continue next;

				if (nx == -1 && ny == -1)
					break;

				while (nx < n + 1 && ny < m + 1) {
					if (c2[nx][ny] != color) {
						c2[nx][ny] = color;
						c2[nx][0]++;
						c2[0][ny]++;
					}
					nx += dx;
					ny += dy;
				}
				answer.add(action);
			}

			out.println(answer.size());
			for (String s : answer) {
				out.println(s);
			}
			return;
		}

		out.println("Poor Kazimir");
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader("supreme.in"));
			out = new PrintWriter("supreme.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
