Chess is one of the oldest board games in the world, sharing fame with Chinese Go, Chinese Chess, and Japanese Shogi. It is said that chess originated from the philosophy of the I Ching, where the board is an $8 \times 8$ black-and-white grid, corresponding to the sixty-four hexagrams, with black and white representing yin and yang.
Our protagonist, Xiao Q, is a fanatical chess enthusiast. As a top-tier player, he is no longer satisfied with the standard board and rules, so he and his good friend Xiao W decided to expand the board to accommodate their new rules.
Xiao Q found a rectangular piece of paper composed of $N \times M$ square cells, where each cell is colored either black or white. Xiao Q wants to cut out a portion of this paper to serve as a new board. Naturally, he hopes this board will be as large as possible.
However, Xiao Q has not yet decided whether to look for a square board or a rectangular board (of course, regardless of the type, the board must be alternating black and white, meaning adjacent cells must have different colors). Therefore, he hopes to find the maximum area of a square board and the maximum area of a rectangular board to decide which is better.
Xiao Q has come to you, as you are about to participate in the National Olympiad in Informatics. Can you help him?
Input
The first line contains two integers $N$ and $M$, representing the length and width of the rectangular paper. The following $N$ lines contain an $N \times M$ matrix of 0s and 1s, representing the colors of the rectangular paper (0 represents white, 1 represents black).
Output
The output should contain two lines, each containing an integer. The first line is the area of the largest square board that can be found, and the second line is the area of the largest rectangular board that can be found (note that the square and rectangle can overlap or be contained within one another).
Constraints
For 20% of the data, $N, M \le 80$. For 40% of the data, $N, M \le 400$. For 100% of the data, $N, M \le 2000$.
Examples
Input 1
3 3 1 0 1 0 1 0 1 0 0
Output 1
4 6