A Place For My Head

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

문제

Artem has constructed a permutation pp of nn integers from 11 to nn during the last Jinotega beer party. Kostya tried to guess it, but had no success. Then Artem gave some hints to Kostya: for each i=1,,ni = 1, \ldots, n, he told him two integers l_ir_il\_i \le r\_i, meaning that element ii is situated between positions l_il\_i and r_ir\_i inclusively. Kostya is sure that the lexicographically smallest permutation satisfying these conditions is the one Artem has constructed. As it is too late, and Kostya's brain is not working as well as usually after several glasses of beer, you need to help him.

입력

The first line of input contains a positive integer nn (1n21051 \le n \le 2 \cdot 10^5), the length of the permutation.

Each of the next nn lines contain two integers l_il\_i and r_ir\_i (1l_ir_in1 \le l\_i \le r\_i \le n).

출력

If it is impossible to reconstruct the permutation, print a line containing the integer 1-1.

Otherwise, print a line containing nn space-separated integers p_1,p_2,,p_np\_1, p\_2, \ldots, p\_n: the desired permutation.