You are given a matrix $$$\textbf{M}$$$ with $$$n$$$ rows and $$$n$$$ columns. Let's define $$$f(i,j,k)=[(\textbf{M}^k)_{i,j}\neq 0]$$$. For each pair of $$$(i,j)$$$ ($$$1\leq i,j\leq n$$$), find the smallest positive integer $$$t$$$ such that $$$f(i,j,k)=f(i,j,k+t)$$$ always holds when $$$k$$$ is sufficiently large.
Note that matrix multiplication should be calculated under $$$\mathbb{Z}$$$.
The first line contains a single integer $$$T$$$ ($$$1 \leq T \leq 20$$$), the number of test cases. For each test case:
The first line contains a single integer $$$n$$$ ($$$1\leq n\leq 60$$$).
Each of the next $$$n$$$ lines contains a binary string of length $$$n$$$. The $$$j$$$-th bit of the $$$i$$$-th string denotes $$$\textbf{M}_{i,j}$$$ ($$$1\leq i,j\leq n$$$). In other words, all the values in $$$\textbf{M}$$$ are in $$$\{0,1\}$$$.
For each test case, output $$$n$$$ lines. Output $$$n$$$ integers in the $$$i$$$-th line, the $$$j$$$-th integer of which denoting the smallest positive integer $$$t$$$ such that $$$f(i,j,k)=f(i,j,k+t)$$$ always holds when $$$k$$$ is sufficiently large. Note that if you can not find such $$$t$$$, output "-1" instead.
19010010000001000001000100000010000000000001000000000100000000010000010001000000000
1 3 3 3 4 4 4 4 12 1 3 3 3 1 1 1 1 3 1 3 3 3 1 1 1 1 3 1 3 3 3 1 1 1 1 3 1 1 1 1 4 4 4 4 4 1 1 1 1 4 4 4 4 4 1 1 1 1 4 4 4 4 4 1 1 1 1 4 4 4 4 4 1 1 1 1 1 1 1 1 1