You are given a matrix $A$ of printable characters with $m$ rows and $n$ columns. Rows are numbered from $1$ by the first index and columns from $1$ by the second index. A single operation replaces the current matrix with a new matrix $B$ according to one of the following rules (the character in backticks is the operation identifier).
1): $B_{j,i} = A_{i,j}$2): $B_{n-j+1,m-i+1} = A_{i,j}$H): $B_{m-i+1,j} = A_{i,j}$V): $B_{i,n-j+1} = A_{i,j}$A), $180$ (B), or $270$ (C) degrees; the $90$-degree case is $B_{j,m-i+1} = A_{i,j}$X), $180$ (Y), or $270$ (Z) degrees; the $90$-degree case is $B_{n-j+1,i} = A_{i,j}$You are given a sequence of at most 100,000 operations from this set. Apply them to the matrix in the given order and output the resulting matrix.
The first line contains two integers $m$ and $n$ ($0 < m, n \le 300$). Each of the next $m$ lines contains exactly $n$ printable characters, where a printable character is a symbol whose ASCII code is between $33$ and $126$ inclusive; these lines contain no other symbols. The following line contains the sequence of operations, each given by its one-character identifier, to be applied from left to right.
Print two integers: the number of rows and the number of columns of the resulting matrix. Then print the resulting matrix in the same format as the input.