beecrowd | 1685

Daniel's Square

By Jonathan Alberth Quispe Fuentes, Universidad Nacional del Altiplano PE Peru

Timelimit: 3

Daniel is a civil engineer, who has been assigned to find possible locations to build a square, however at the request of local people to build the square no tree should be cut.

Daniel has satellite images of the place, he needs to maximize the area of the square and report their possible locations. Could you help?

Input

The first line cantains the number of test case T (T <= 40).

The second line contains two integers n and m (1<= n, m <= 1000), the height and width of the image.

The following n lines contain the information of the image, where " * " represents land occupied by trees and " . " represents free land. There is at least a " . " in the image.

Output

For each test case, print the maximun side of the square followed by the list of the left top point of each square in the image (sorted by row and in case of a tie for column). Check the sample for more detail.

Do not print blank lines between two test cases.

Sample Input Sample Output

1
5 10
**********
*.....****
*........*
****.....*
**********

The side of the square is 2 and the locations are:
2 2
2 3
2 4
2 5
3 5
3 6
3 7
3 8
8 in total.