You have been hired to program the manager of windows of the new operating system preferred by everybody, Windows Vista-ZO. The new screeen of the new Windows is a grid plane virtually infinite; the visible part of the screen is a rectangle of 40 by 10 blocks. The grid that takes the corner at the bottom on the left of the visible part has coordinates (0,0), the one at the top on the right has coordinates (39, 9). The blocks of the screen can be empty (it is marked with the character .) or taken by a window. Initially the screen is empty and the cursor is in (0,9).
The windows are painted one over another one. A window takes (overwrites) the block that may be occupied by a previous window. Each window is a rectangular that must be painted in the following way (the instance of the next page make easier the comprehension):
Your task is to write a program that prints the result screen after being executed various orders. In particular the possible orders are:
The cursor can move out of the screen; the painted windows do not have always to start to be painted inside the screen, and do not have always to fit inside the screen.
Input
The first line contains the natural n≥ 0 (the total number of cases to do). Each case consists of a line with the natural m≥ 0 (the number of orders to execute) followed by m lines, each one of them contains an order to execute, following the described format previously. During the paint orders, the coordinates of the cursor always fulfil |x|<106 y |y|<106.
Output
Your program must print 10 lines of 40 characters for each case to do. Separe two cases with a line that contains only a comma (,). Therefore, if n>0 the output must exactly have 10n+(n−1) lines.
Input
0
Output
Input
1 0
Output
........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................
Input
2 1 DRAW 40 10 0
Output
#======================================# !11111111111111111111111111111111111111! !11111111111111111111111111111111111111! !11111111111111111111111111111111111111! !11111111111111111111111111111111111111! !11111111111111111111111111111111111111! !11111111111111111111111111111111111111! !11111111111111111111111111111111111111! !11111111111111111111111111111111111111! #--------------------------------------# , ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................
Input
2 11 DRAW 10 10 MOVREL 3 -3 DRAW 10 10 MOVREL 3 -3 DRAW 10 10 MOVREL 3 -3 DRAW 10 10 MOVREL 3 -3 DRAW 10 10 MOV 2 7 DRAW 6 6 22 MOVREL 500000 500000 DRAW 10 10 DRAW 100 100 DRAW 4 4 DRAW 10 10 MOVREL 0 0 MOVREL -500000 -500000 DRAW 10 10 MOVREL 4999990 500010 DRAW 100 40 MOV -2 12 DRAW 6 6 MOV 36 12 DRAW 6 6 MOV -2 3 DRAW 6 6 MOV 36 3 DRAW 6 6 MOVREL -20 7 DRAW 6 6 MOVREL 10 0 DRAW 3 3
Output
#========#.............................. !11111111!.............................. !1#====#1!.............................. !1!6666!====#........................... !1!6666!2222!........................... !1!6666!2222!........................... !1!6666!=======#........................ !1#----#3333333!........................ !11!22!33333333!........................ #--!22!33#========#..................... , 777!=====#......!1111!....!2!.......!888 777!55555!......!1111!....#-#.......!888 ---#55555!......!1111!..............#--- !55555555!......!1111!.................. !55555555!......#----#.................. !55555555!.............................. ===#55555!..........................#=== 999!55555!..........................!000 999!55555!..........................!000 999!-----#..........................!000