Viktor and the Busy Teachers#497

Viktor and the Busy Teachers

1 second
128 megabytes
Very easy

Given test cases.

Each test case contains a number (1 \leq n \leq 100) — the number of subjects Viktor has to pass. Then lines follow, each containing two numbers and (1 \leq a \leq b \leq 31), which specify the working interval of the corresponding teacher.

Input

The first line contains a single integer — the number of test cases.

Then all tests are described. For each test, the first line contains the number (1 \leq n \leq 100). Then lines follow, each containing two numbers and (1 \leq a \leq b \leq 31) — the working interval of the corresponding teacher.

Output

For each test, print on a separate line YES if it is possible to pass all subjects in one day, or NO if it is impossible.

Examples

Example 1

Loading
Loading