Suprematism
Kazimir recently explored various art movements in his art classes and was particularly captivated by Suprematism. Inspired, he decided to create his first painting in this style. He started by drawing a rectangle of size n×m, composed of multicolored squares, each measuring 1×1. Upon reflection, Kazimir realized that his artwork was too intricate and might not convey his intended message clearly. Without a spare canvas, he resolved to simplify his painting. To Kazimir, a truly simple painting should consist of just one color.
To achieve this, Kazimir can perform the following operations: He can select a row where more than half of the squares are the same color and repaint the entire row in that color. Similarly, he can choose a column where more than half of the squares share the same color and repaint the entire column in that color.
Your task is to help Kazimir determine if he can simplify his painting using these operations.
Input
The first line contains two integers n and m (1 ≤ n, m ≤ 300), representing the dimensions of the painting. The next n lines each contain m integers c_{i,j} (1 ≤ c_{i,j} ≤ 1000000), indicating the colors of the squares in the painting. It is guaranteed that at least two different colors are present in the painting.
Output
If Kazimir cannot simplify the painting to a single color, output "Poor Kazimir". Otherwise, output the number k — the number of operations Kazimir needs to perform.
The operations are of two types:
R r — repaint row r (1 ≤ r ≤ n).
C c — repaint column c (1 ≤ c ≤ m).
Kazimir is allowed to perform no more than 1000 operations.