{"raw_statement":[{"iden":"problem statement","content":"There are $N$ people on a number line.\nPerson $i$ $(1\\le i\\le N)$ is initially at coordinate $S_i$, and wants to eventually move to coordinate $T_i$. It is guaranteed that $S_1,S_2,\\ldots,S_N,T_1,T_2,\\ldots,T_N$ are all distinct.\nYou fix one permutation $P=(P_1,P_2,\\ldots,P_N)$ of $(1,2,\\ldots,N)$ and perform $N$ operations in order. In the $i$\\-th operation $(1\\le i\\le N)$, you move person $P_i$ from coordinate $S_{P_i}$ to coordinate $T_{P_i}$ along the shortest path on the number line. However, if there is another person on the movement path, a fight occurs.\nDetermine if there exists a $P$ such that no fight occurs, and if it exists, find one."},{"iden":"constraints","content":"*   $1\\le N\\le 2\\times 10^5$\n*   $1\\le S_i, T_i \\le 10^9$\n*   $S_1,S_2,\\ldots,S_N,T_1,T_2,\\ldots,T_N$ are all distinct.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$S_1$ $T_1$\n$S_2$ $T_2$\n$\\vdots$\n$S_N$ $T_N$"},{"iden":"sample input 1","content":"4\n1 3\n2 4\n7 5\n8 10"},{"iden":"sample output 1","content":"Yes\n3 2 1 4\n\nIf $P=(3,2,1,4)$, then the $N$ operations proceed as follows.\n\n*   $1$st operation: Move person $3$ from coordinate $7$ to coordinate $5$. The other three people are at coordinates $1,2,8$, so no fight occurs.\n*   $2$nd operation: Move person $2$ from coordinate $2$ to coordinate $4$. The other three people are at coordinates $1,5,8$, so no fight occurs.\n*   $3$rd operation: Move person $1$ from coordinate $1$ to coordinate $3$. The other three people are at coordinates $4,5,8$, so no fight occurs.\n*   $4$th operation: Move person $4$ from coordinate $8$ to coordinate $10$. The other three people are at coordinates $3,4,5$, so no fight occurs.\n\nTherefore, outputting $P=(3,2,1,4)$ will be accepted.\nOther acceptable outputs include $P=(4,3,2,1),(2,1,3,4)$."},{"iden":"sample input 2","content":"2\n1 3\n4 2"},{"iden":"sample output 2","content":"No\n\nThere is no $P$ such that no fight occurs. Therefore, output `No`."},{"iden":"sample input 3","content":"5\n19 17\n1 10\n9 14\n3 11\n8 13"},{"iden":"sample output 3","content":"Yes\n3 5 1 4 2"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}