{"scoring":null,"notes":"","legend":"In this problem, a \\textit{hex} is a six-sided board\r\nconsisting of \\textit{cells}: small regular hexagons.\r\nA hex of size $n$ has $n$ cells on each side.\r\nEach cell contains an integer.\r\n\r\nConsider the following operations with a hex:\r\n\r\n\\begin{shortitems}\r\n\\item ``\\texttt{T}'': reflect the hex over its vertical symmetry axis,\r\n\\item ``\\texttt{R}'': rotate the hex 60 degrees clockwise,\r\n\\item ``\\texttt{L}'': rotate the hex 60 degrees counter-clockwise.\r\n\\end{shortitems}\r\n\r\nHere is an example of a hex of size $n = 3$ and operations with it:\r\n\r\n\\begin{center}\r\n\\includegraphics[scale=0.36]{hex-operations-001.eps}\r\n\\end{center}\r\n\r\nYou are given a hex and a sequence of operations.\r\nPerform all the given operations in order and print the resulting hex.\r\n","authorLogin":"gassa","language":"english","timeLimit":2000,"output":"Print the hex after performing all operations:\r\n$2 n - 1$ lines containing integers.\r\nEach line should contain several space-separated integers: exactly as many\r\nas the number of cells in the corresponding row of the hex.\r\nAdditionally, for ease of reading, these lines may contain\r\nadditional spaces before all numbers, between consecutive numbers,\r\nand after all numbers.\r\n\r\nThe total size of the output, including spaces and line breaks,\r\nshould not exceed $2^{23}$~bytes.\r\n","inputFile":"stdin","outputFile":"stdout","input":"The first line contains an integer~$n$,\r\nthe size of the hex ($2 \\le n \\le 500$).\r\nThe next $2 n - 1$ lines contain integers from~$1$ to~$99$\r\ninitially contained in the cells of the hex.\r\nEach line contains space-separated integers: exactly as many\r\nas the number of cells in the corresponding row of the hex.\r\nAdditionally, for ease of reading, these lines may contain\r\nadditional spaces before all numbers, between consecutive numbers,\r\nand after all numbers.\r\n\r\nThe last line is the sequence of operations.\r\nIt has a length from~$1$ to~$250\\,000$ characters\r\nand consists of letters ``\\texttt{T}'',~``\\texttt{R}''~and~``\\texttt{L}''.\r\n\r\nThe total size of the input, including spaces and line breaks,\r\ndoes not exceed $2^{23}$~bytes.\r\n","authorName":"Ivan Kazmenko","sampleTests":[{"output":"  9 9 8\r\n 9 1 1 7\r\n8 7 6 1 8\r\n 1 1 5 1\r\n  2 3 4\r\n","input":"3\r\n  4 1 8  \r\n 3 5 1 7 \r\n2 1 6 1 8\r\n 1 7 1 9 \r\n  8 9 9  \r\nLTR\r\n","inputFile":"example.01","outputFile":"example.01.a"}],"name":"Hex Operations","interaction":null,"memoryLimit":1073741824,"tutorial":""}