text: The following n lines of each test case contain the binary grid, square (1, 1) being colored in 'S' and square (n, n) being colored in 'F'.The sum of values of n doesn't exceed 200.Output For each test case output on the first line an integer c (0 ≤ c ≤ 2) — the number of inverted cells.In i-th of the following c lines, print the coordinates of the i-th cell you inverted.You may not invert the same cell twice.Note that you cannot invert cells (1, 1) and (n, n).Example Input 3 4 S010 0001 1000 111F 3 S10 101 01F 5 S0101 00000 01111 11111 0001F Output 1 3 4 2 1 2 2 1 0 Note For the first test case, after inverting the cell, we get the following grid: S010 0001 1001 111F # Solution l=[] for _ in range(int(input())): n=int(input()) a=[] for i in range(n): a.append(list(input())) if a[0][1]==a[1][0]: if a[n-1][n-2]==a[n-2][n-1]: if a[n-1][n-2]==a[0][1]: l.append("2") l.append("1 2") l.append("2 1") else: l.append("0") else: if a[n-1][n-2]!=a[0][1]: l.append("1") l.append(str(n-1)+" "+str(n)) else: l.append("1") l.append(str(n)+" "+str(n-1)) else: if a[n-1][n-2]==a[n-2][n-1]: if a[n-1][n-2]!=a[0][1]: l.append("1") l.append("2 1") else: l.append("1") l.append("1 2") else: if a[0][1]!=a[n-2][n-1]: l.append("2") l.append("1 2") l.append(str(n-1)+" "+str(n)) else: l.append("2") l.append("2 1") l.append(str(n - 1)+" "+ str(n)) for i in l: print(i)