You are given a set of points Z and a tolerance value S. Write a program that processes two kinds of operations:
The upper-left point is defined as follows. Let ymax be the largest y-coordinate among the points currently in Z. Consider as candidates every point whose y-coordinate is smaller than ymax by at most S, that is, every point with y≥ymax−S. Among the candidates, the upper-left point is the one with the smallest x-coordinate (the leftmost one). If several candidates share the smallest x-coordinate, choose the one with the largest y-coordinate (the highest one).
The first line contains the number of test cases T (1≤T≤10). The test cases follow.
The first line of each test case contains two space-separated integers N and S (1≤N≤105, 0≤S≤109), the initial size of the set Z and the tolerance value. Each of the next N lines contains two space-separated integers PX and PY (−109≤PX,PY≤109), describing a point of Z. All points within one test case are distinct.
The next line contains an integer M (1≤M≤2⋅105), the number of operations to perform. Each of the following M lines has one of the two forms:
USUN PX PY : remove the point (PX,PY) from the set Z.ZNAJDZ : find the upper-left point.A point named in a remove operation is guaranteed to be present in Z at that moment. A find operation is never issued while Z is empty.
For every find (ZNAJDZ) operation, print the coordinates of the found point as x y on its own line.