Given an $n\times n$ matrix $A$ and a $3\times 3$ matrix $K$. These two matrices are very special : they are both non-negative matrices and the sum of all elements in matrix $K$ is 1 (In order to avoid floating-point error, we will give matrix $K$ in a special way in input).
Now we define a function $C(A,K)$, the value of $C(A,K)$ is also a $n\times n$ matrix and it is calculated below(we use $C$ to abbreviate $C(A,K)$):
$C_{x,y}=\sum_{i=1}^{min(n-x+1,3)}\sum_{j=1}^{min(n-y+1,3)}A_{x+i-1,y+j-1}K_{i,j}$
Now we define $C^{m}(A,K)=C(C^{m-1}(A,K),K)$ and $C^{1}(A,K)=C(A,K)$, Kanade wants to know $lim_{t\rightarrow \infty}C^{t}(A,K)$
It's guaranteed that the answer exists and is an integer matrix.