{"raw_statement":[{"iden":"problem statement","content":"For real numbers $L$ and $R$, let us denote by $[L,R)$ the set of real numbers greater than or equal to $L$ and less than $R$. Such a set is called a right half-open interval.\nYou are given $N$ right half-open intervals $[L_i,R_i)$. Let $S$ be their union. Represent $S$ as a union of the minimum number of right half-open intervals."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2\\times 10^5$\n*   $1 \\leq L_i \\lt R_i \\leq 2\\times 10^5$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$L_1$ $R_1$\n$\\vdots$\n$L_N$ $R_N$"},{"iden":"sample input 1","content":"3\n10 20\n20 30\n40 50"},{"iden":"sample output 1","content":"10 30\n40 50\n\nThe union of the three right half-open intervals $[10,20),[20,30),[40,50)$ equals the union of two right half-open intervals $[10,30),[40,50)$."},{"iden":"sample input 2","content":"3\n10 40\n30 60\n20 50"},{"iden":"sample output 2","content":"10 60\n\nThe union of the three right half-open intervals $[10,40),[30,60),[20,50)$ equals the union of one right half-open interval $[10,60)$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}