To confuse his pursuers, Neo has invented a way to rotate the Matrix. However, Neo can only rotate the Matrix 90, 180, or 270. Help Neo compute a given rotation of the Matrix.
The input consists of several test cases. Each test case starts with the number of rows and the number of columns of the Matrix, as well as the number of degrees that Neo wants to rotate the Matrix. This is followed by rows with integers each.
For each test case, the matrix that results from rotating the Matrix degrees.
Input
3 4 90 9 1 2 4 2 7 2 3 7 5 1 3
Output
4 3 3 2 2 1 1 7 5 9 2 7
Input
4 2 0 9 2 4 7 1 5 3 8
Output
9 2 4 7 1 5 3 8
Input
3 3 180 9 1 2 6 2 7 8 4 4
Output
4 4 8 7 2 6 2 1 9