Bad Signal#6407

Bad Signal

1 second
122.174 megabytes
Very easy

There is an important UN meeting in town. Any self-respecting espionage agency will try to eavesdrop on the delegations to gain some advantage in the negotiations. They do this by planting hidden microphones in and around the meeting places. Those microphones continuously capture sound waves and transmit them via radio.

In fact, fierce competition between espionage agencies has left the whole city scattered with hidden microphones, so much so that the radio waves interfere with each other and it is often not even possible to make out any signal in the mess of radio waves – depending on your position and proximity to the different transmitters obviously.

Specifically, it is possible to make out a signal if and only if:

Where

Input

On the first line one positive number: the number of test cases, at most . After that per test case:

  • one line with an integer (0 \le n \le 100000): the number of planted microphones.

  • one line with the integer (0 \le B \le 1000000): the level of background noise.

  • one line with two space-separated integers and : the and coordinates of the location P_{listen} where you receive the signals.

  • lines with three space-separated integers x_i, y_i and s_i (0 < s_i \le 1000000): the and coordinates of the location P_i of microphone and its signal strength, respectively.

All coordinates are in the range . The locations P_i all differ from P_{listen}. The test data is constructed so that small floating point rounding errors will not influence the outcome of any solution.

Output

Per test case:

  • one line with an integer: the (one-based) index of a microphone, the signal of which can be made out, or the string "NOISE" if there is no such microphone.

Examples

Example 1

Loading
Loading