In a kindergarten, a test is conducted where children are shown white rectangular sheets of paper divided into equal squares by horizontal and vertical lines. Some of these squares are painted black, while others remain white.
A "figure" in this context is defined as a group of black squares. For any two squares in this group, their centers can be connected by a path that stays entirely within the black squares and does not pass through any square's vertex.
Two figures are considered different if they cannot be made identical through a series of parallel translations, 90^\circ rotations, or reflections across a vertical or horizontal line.
The task for the children is to determine how many figures are present in the drawing and how many of these figures are distinct.
Create a program that provides the correct answers to these questions.
The first line contains the number of squares, , which are arranged in a grid both vertically and horizontally.
The following lines each contain characters representing the drawing. A space (' ') indicates a white square, while any other character represents a black square.
In of the tests, n \le 30; in of the tests, n \le 90; in of the tests, n \le 180; in of the tests, n \le 360; and in all tests, n \le 528.
The number of cells in a single figure does not exceed: in of the tests, in of the tests, in of the tests, in of the tests, in of the tests, and in of the tests.
Output a single line containing two natural numbers: the total number of figures and the number of distinct figures. It is guaranteed that both numbers do not exceed .
Example 1