Ran loves intervals, inversions and trees, so she wants to make a problem mixing all of them together!
Ran has a unknown permutation p of length n and m pairwise distinic intervals, the i-th one is
![[l_i,r_i]](https://www.nowcoder.com/equation?tex=%5Bl_i%2Cr_i%5D)
. It's guaranteed that for two intervals

and

, let

(if

, let

), then

or

always holds.
There will be

restrictions, the

-th one is like the number of inversions in
![[l_i,r_i]](https://www.nowcoder.com/equation?tex=%5Bl_i%2Cr_i%5D)
must be odd/even. An inversion in an array

is a pair of indices
)
such that

and

.
Now Ran want you to construct a permutation

and meet all restrictions, or report it is impossible.