beecrowd | 3004

Envelopes

By Paulo E. D. Pinto, Universidade do Estado do Rio de Janeiro BR Brazil

Timelimit: 3

One company wants to send a customer an envelope to get an answer and wants to know if it is possible to put that envelope inside another. Both envelopes are rectangular and the first can only be placed inside the second if its dimensions are both smaller. Given the size of the two envelopes, answer whether or not you can put the first one inside the second.

Input

The input consists of many tests. The first line contains the number of test cases, an integer n (1 ≤ n ≤ 20),  The next n lines contain, each one, a test case, composed of four integers:  the first two integers are the dimensions of the first envelope e the last two, the dimensions of the second envelope.

Output

For each test case print, in one line:

. 'S' if the first envelope can be put inside the second one.

Otherwise, print 'N'.

Input Sample Output Sample

3

10 10  10 20

19 2 3 20

2 20 5  15

N

S

N