A. Charged Intervals
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given $$$n$$$ intervals $$$[l_i, r_i]$$$. Assign a charge of $$$+1$$$ or $$$-1$$$ to each interval such that for every integer $$$i$$$ the following holds:

The sum of charges of intervals containing $$$i$$$ is $$$+1$$$, $$$-1$$$ or $$$0$$$. If no intervals contain $$$i$$$, this sum of charges is considered to be $$$0$$$.

The interval $$$[l, r]$$$ is said to contain an integer $$$j$$$ if and only if $$$l \le j \le r$$$.

Input

The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of each test case follows.

The first line contains a single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of intervals.

The next $$$n$$$ lines each contain two integers $$$l_i$$$ and $$$r_i$$$ ($$$0 \le l \le r \le 2 \cdot 10^5$$$).

It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$2 \cdot 10^5$$$.

Output

For each test case, if there doesn't exist an assignment that satisfies the above constraints, print NO. Otherwise, print YES followed by $$$n$$$ integers $$$c_1, c_2, \dots, c_n$$$ ($$$c_i \in \{-1, 1\}$$$) on a new line — the charges assigned to the intervals in the order that they appear in the input.

Example
Input
4
4
10 27
8 24
6 19
21 22
1
12 12
3
2 26
11 14
17 29
2
8 23
22 29
Output
YES
1 -1 1 1 
YES
1 
YES
1 -1 -1 
YES
1 -1