Evacuation

아직 제출이 없습니다시간 제한4초메모리 제한512 MB

문제

It is a dark and stormy night. Our agent has just performed a dangerous mission in Central America. His life is in danger, so he must be evacuated at once. The only place from which a helicopter can pick him up is a straight road going through the jungle. The agent starts at the middle of the road (marked as position 0) and can walk in either direction with the speed of 1 meter per second (it is, as we said before, a dark and stormy night).

Unfortunately, weather conditions have just gotten even worse. A thunderstorm is coming our way, with its lightning strikes being a danger to both the helicopter and the agent. Therefore, there are only a few set times and places at which our helicopter can land. With our state-of-the-art equipment, we can predict where and when exactly will the lightning strike, and the area that is going to be burned. With this knowledge, determine which landing spots the agent can reach on time, avoiding the strikes.

Note that if both landing spot and lightning strike have the same time tt and they are closer to each other than rr, the evacuation is impossible

입력

The first line of input contains the number of test cases zz. The descriptions of the test cases follow.

The first line of each test case contains an integer nn (0n200,0000 \leq n \leq 200\\,000): the number of lightning strikes. Each of the following nn lines describes an expected lightning strike, containing three integers t,x,rt, x, r (0t1090 \leq t \leq 10^9, 109x109-10^9 \leq x \leq 10^9, 1r1091 \leq r \leq 10^9): the time tt, position xx and blast radius rr of the strike.  The agent should be at least rr meters away from the lightning at time tt, or he will be fried.

The next line contains the number of possible landing spots ss (1s200,0001 \leq s \leq 200\\,000). Each the following ss lines contains two integers t,xt, x (0t1090 \leq t \leq 10^9, 109x109-10^9 \leq x \leq 10^9) meaning that the helicopter can land at time tt and position xx. You must determine if the agent can also be there at this time.

The total number of all lightning strikes and landing spots together in all test cases does not exceed 1,300,0001\\,300\\,000.

출력

For each test case, determine for all landing spots if the agent can be there at given time (without being struck by lightning), and output a line containing the answers. For each landing spot in the order they are given, output a single character '@' if the agent can be evacuated from that spot, and '*' otherwise.