P12238 [AOJ] Shifting a Matrix
普及
题目描述

Example

Input

3 2
R1

Output

3 1 2
4 5 6
7 8 9

输入格式

见题面

输出格式

见题面

样例输入
3 2 R1
样例输出
3 1 2 4 5 6 7 8 9