Binary String Toggle

Apply U range-toggle operations to an all-zero binary string and print the lexicographically largest string among all U+1 intermediate states.

Medium7Prefix sumGreedyImplementationInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

There is a binary string S0S_0 of length NN whose characters are all 0. You apply UU toggle operations to it. The ii-th operation turns Si1S_{i-1} into SiS_i, so once all UU operations are done the string is SUS_U.

The ii-th operation is given as two integers LiL_i and RiR_i. It flips every character in the range [Li,Ri][L_i, R_i]. Both ends included, every 1 inside that range becomes 0 and every 0 becomes 1.

Applying all operations gives the strings S0,S1,,SUS_0, S_1, \dots, S_U. Write a program that finds the one that comes last in lexicographic order among these U+1U+1 strings.

Input

The first line contains NN and UU. (1N,U100,0001 \le N, U \le 100{,}000)

Each of the next UU lines contains LiL_i and RiR_i. (1LiRiN1 \le L_i \le R_i \le N)

Output

On the first line, print the string that comes last in lexicographic order among the U+1U+1 strings.

Hint

For the example input, the string changes in this order.

  • S0S_0 = 0000000000
  • S1S_1 = 0000000011
  • S2S_2 = 0000011100
  • S3S_3 = 0000011111
  • S4S_4 = 1111100011
  • S5S_5 = 1100000011
  • S6S_6 = 1110000011
  • S7S_7 = 1101000011
  • S8S_8 = 1110111101
  • S9S_9 = 1111000001
  • S10S_{10} = 1111001001