As a hard-working farmer with a grand farm, Bob always takes care of everything in the farm by himself. Planting the crop one by one is so satisfying that he is happy everyday. Happy as Bob is, he is also forgetful. To keep the crop safe, each piece of crop should come with a fence, yet Bob sometimes forgets to set a fence when planting the crop.
In this rural area, thieves come and go. Those notorious thieves steal the crop without protection of a fence. Feeling tired of keeping an eye on all the crop, Bob decides to build a monitor system to keep track of every activity happening in the farm.
In the monitor system, the farm is a 2-dimensional space. The system receives 4 kinds of instructions: 3 instructions recording the activities, and 1 instruction displaying the state in the farm. The instructions are described as follows:
2. Thief
"THIEF x y" means a thief visits position (x, y). Besides (x, y), the thief also scans (x+1, y), (x-1, y), (x, y+1), (x, y-1). Among the five positions, the crop will be stolen where the fence has not been set.
3. Super Thief
"SUPER_THIEF x y" means the more dangerous thief visits position (x, y). Besides (x, y), the thief also scans (x+1, y), (x-1, y), (x, y+1), (x, y-1), (x-1, y-1), (x-1, y+1), (x+1, y+1), (x+1, y-1). Among the nine positions, the crop located in the position without a fence will be stolen.
4. Display
"DISPLAY" prints out all the crop’s location from the left to the right, and then the bottom to the top.
Please refer to the demo below.
The first line contains an integer N, representing the number of instructions.
The following N lines represent the order of the instruction and coordinate position.
Each line starts with a string si, representing the type of instruction. si will be one of the following strings: PLANT, THIEF, SUPER_THIEF, or DISPLAY.
If si is PLANT, si is followed by three integers x, y and fence, representing x , y coordinate and with fence or not (1 or 0)
If si is THIEF or SUPER_THIEF, si is followed by two integers x and y, representing x coordinate and y coordinate.
If si is DISPLAY, there will be no more following element in the same line.
It is guaranteed that:
Test case #1~#8: N ≤ 150, -1010 < x, y < 1010
Test case #9: N ≤ 1000, -1010 < x, y < 1010
Test case #10: N ≤ 5000, -1010 < x, y < 1010
You only need to output when the instruction is DISPLAY. Print the text “Display” first, and then print out the plants’ locations in your farm from left to right and then bottom to top (Notice: Each location will be printed in one line in the form “(x,y)”. For example, you’ll print out 3 lines if there’re two pieces of crop left - one for “Display”, two for the plants’ locations ). If there is no plant in your farm, just print “Display”.