Image compression
Agent Johnny English entered the enemy's lair and found a secret image in it, which must be urgently transferred to the command center. Before doing this, however, it must be compressed to keep the transmission time to a minimum.
The image is a rectangle n * m, divided into n * m unit cells - pixels. Each pixel can be either black or white.
Let's describe the image compression process. Johnny can split the entire image into rectangles of the same size (all rectangles must have the same height and width). If, as a result of this splitting, it turns out that all pixels in each rectangle have the same color, Johnny can replace each resulting rectangle with one pixel of the corresponding color. For a better understanding of the image compression process, study the tests from the example.
Help Johnny find the image compression that contains the minimum number of pixels.
Input
The first line contains two integers n and m (1 ≤ n, m ≤ 3000) - the height and the width of the original image, respectively. Then n lines follow, each consists of m characters describing the colors of the pixels in the original image. The "." symbol represents a white pixel, and the "X" symbol represents a black pixel.
Output
Print a description of the image compression. Follow the same format as in the input.