Everyone knows that laughter comes in three types of pitches: up, down, and right. Kiara is especially interested in the laughing patterns of her friend, and wishes to graph it out to see what interesting shapes come out.
Kiara wants you to generate the graph of a laugh that is pitches long. Each pitch will be given to you either as the character
^ (for up),
v (for down), or
> (for right).
To generate the graph, imagine that you are working on a 2D grid of characters with infinite rows and columns. In the beginning, all characters in the grid are set to
., and your cursor is positioned in the first column. For every pitch given to you, perform the respective action:
^pitch: replace the current character with
/, and move the cursor one character to the right and one character up.
vpitch: move the cursor one character down, replace the current character with
\, and move the cursor one character to the right.
>pitch: replace the current character with
_, and move the cursor one character to the right.
Although our hypothetical grid has infinite rows, for ease of comprehension, you should output only the rows which contain a character that is not
. (i.e. print out all rows that contain one of
The first line will contain a single integer .
The second line will contain a string of characters, each of which will be one of
Output the laugh graph, using the procedure described.
Sample Input 1
Sample Output 1
...../ \.../. .\_/..
Sample Input 2
Sample Output 2
\.... .\... ..\.. ...\. ....\
Explanation of Sample Output 2
Note that only rows containing non-
. characters should be included.