After finishing Gregory's task, you feel like a genius and have a strong desire to solve more challenging problems. The next thing you want to do is a bit similar to the previous task: given a 2-dimensional array A, with size n * n, you want to
The following shows some 3 * 3 subarray examples for a given 5 * 5 array.
Since in this case, the 3 * 3 subarray at the lower right corner has the maximum first element, you should rotate it.
The subarray would be rotated counterclockwise and will only be rotated by a degree that is a multiple of 90:
Note:
The first line contains an integer n, which means the size of A is n * n.
Each of the following n lines contains n positive integers, representing A.
The last line contains two integers m and b, which means the subarray size and the angle you want to rotate, respectively.
It is guaranteed that all numbers in A are less than 103.
Constraints:
3 ≤ n ≤ 100
1 ≤ m ≤ n
0 ≤ b ≤ 104
b ≡ 0 (mod 90)
Output contains n lines, each having n integers that represent the rotated array.