A. Mental Rotation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Mental rotation is a difficult thing to master. Mental rotation is the ability to imagine in your mind how an object would look like from a viewer's side if you were to rotate it in a particular direction. It is something very important for engineers to learn and master, especially if you are required to do engineering drawing. There are many stages to these mental rotation tasks. We will approach a simple rotation task in this problem.

If you are given the following square -

After rotating it to the right once, it will look like the following -

After rotating it to the left once, it will look like the following -

For this problem you will be given an initial square of size n and a list of rotations to perform.

Your task is to output the final representation of the square after performing all the rotation.

Input

The first line of input contains an integer $$$N$$$ (1 ≤ $$$N$$$ ≤ 1000). and a string containing a combination of $$$'L'$$$ and $$$'R'$$$. Where $$$'L'$$$ means left rotation and $$$'R'$$$ means right rotation. Length of the string will not exceed 100. Starting from the second line, the following $$$N$$$ line each will contain $$$N$$$ of the following characters ($$$>$$$, $$$<$$$, $$$∨$$$, $$$∧$$$ or $$$.$$$). Empty space is indicated by a '$$$.$$$' (dot).

Output

The output should be $$$N$$$ lines, each containing $$$N$$$ characters representing the final representation of the square after all the rotation. For $$$∨$$$ and $$$∧$$$ use $$$v$$$ (small v) and Shift+6 respectively.

Examples
Input
3 R
>v>
...
<^<
Output
^.v
>.<
^.v
Input
3 L
>v>
...
<^<
Output
^.v
>.<
^.v
Input
3 LL
>v>
...
<^<
Output
>v>
...
<^<