Bayan Testing

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Let us recall a well-known problem (also called a "bayan" in Russian). You are given an array a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n of integers. Answer the queries: given a segment \[l,r]\[l, r] (1lrn1 \leq l \leq r \leq n), check if there exist two equal elements among a_l,a_l+1,,a_ra\_l, a\_{l+1}, \ldots, a\_r.

Please help to make good tests for this well-known problem! You are given two integers nn, mm, and also 2m2m different segments \[l_i,r_i]\[l\_i, r\_i]. Find any array a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n such that, for exactly mm queries, the answer is positive, and for exactly mm queries, the answer is negative. You should report if there is no such array.

입력

The first line contains a single integer tt (1t1051 \leq t \leq 10^5) --- the number of test cases. Description of test cases follows.

The first line of each test case contains two integers nn, mm (2n21052 \leq n \leq 2 \cdot 10^5, 1m1051 \leq m \leq 10^5).

Each of the next 2m2m lines contains two integers l_il\_i, r_ir\_i (1l_ir_in1 \leq l\_i \leq r\_i \leq n) --- the given segments. It is guaranteed that all segments are different.

It is guaranteed that the sum of nn for all test cases does not exceed 21052 \cdot 10^5 and the sum of mm for all test cases does not exceed 10510^5.

출력

For each test case, print the answer to the problem.

If such an array aa exists, print nn integers a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n (1a_i1091 \leq a\_i \leq 10^9). Otherwise, print a single integer 1-1.

If there are several possible answers, print any one of them.

힌트

Let us consider the third test case. In this case, f(2,2)=0f(2, 2) = 0, f(2,3)=0f(2, 3) = 0, f(2,4)=0f(2, 4) = 0, f(2,5)=0f(2, 5) = 0, f(3,3)=0f(3, 3) = 0, f(3,4)=2f(3, 4) = 2, f(3,5)=2f(3, 5) = 2, f(4,4)=0f(4, 4) = 0, f(4,5)=2f(4, 5) = 2, f(5,5)=0f(5, 5) = 0. So the answer is 66.