{"problem":{"name":"01 Balanced","description":{"content":"Consider making a string $s$ of length $N$ consisting of `0` and `1`, where $s$ must satisfy $M$ conditions. The $i$\\-th condition is represented by integers $L_i$ and $R_i$ ($1 \\leq L_i < R_i \\leq N$","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":5000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc056_c"},"statements":[{"statement_type":"Markdown","content":"Consider making a string $s$ of length $N$ consisting of `0` and `1`, where $s$ must satisfy $M$ conditions. The $i$\\-th condition is represented by integers $L_i$ and $R_i$ ($1 \\leq L_i < R_i \\leq N$). This means that there should be equal numbers of `0` and `1` between the $L_i$\\-th and $R_i$\\-th characters (inclusive) of $s$.\nFind the lexicographically smallest string $s$ that satisfies all conditions. It can be proved that the Constraints of the problem guarantee the existence of $s$ that satisfies the conditions.\n\n## Constraints\n\n*   $2 \\leq N \\leq 10^6$\n*   $1 \\leq M \\leq 200000$\n*   $1 \\leq L_i < R_i \\leq N$\n*   $(R_i-L_i+1) \\equiv 0 \\mod 2$\n*   $(L_i,R_i) \\neq (L_j,R_j)$ ($i \\neq j$)\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$L_1$ $R_1$\n$L_2$ $R_2$\n$\\vdots$\n$L_M$ $R_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc056_c","tags":[],"sample_group":[["4 2\n1 2\n3 4","0101"],["6 2\n1 4\n3 6","001100"],["20 10\n6 17\n2 3\n14 19\n5 14\n10 15\n7 20\n10 19\n3 20\n6 9\n7 12","00100100101101001011"]],"created_at":"2026-03-03 11:01:14"}}