#abc216g. [abc216_g]01Sequence

[abc216_g]01Sequence

Problem Statement

Consider a sequence of length NN consisting of 0s and 1s, A=(A1,A2,dots,AN)A=(A_1,A_2,\\dots,A_N), that satisfies the following condition.

For every i=1,2,dots,Mi=1,2,\\dots,M, there are at least XiX_i occurrences of 1 among ALi,ALi+1,dots,ARiA_{L_i}, A_{L_i+1}, \\dots, A_{R_i}.

Print one such sequence with the fewest number of occurrences of 1s.

There always exists a sequence that satisfies the condition under the Constraints.

Constraints

  • 1leqNleq2times1051 \\leq N \\leq 2 \\times 10^5
  • $1 \\leq M \\leq \\min(2 \\times 10^5, \\frac{N(N+1)}{2} )$
  • 1leqLileqRileqN1 \\leq L_i \\leq R_i \\leq N
  • 1leqXileqRiLi+11 \\leq X_i \\leq R_i-L_i+1
  • (Li,Ri)neq(Lj,Rj)(L_i,R_i) \\neq (L_j,R_j) if ineqji \\neq j.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM L1L_1 R1R_1 X1X_1 L2L_2 R2R_2 X2X_2 vdots\\vdots LML_M RMR_M XMX_M

Output

Print a sequence AA consisting of 0s and 1s, with spaces in between.

A1A_1 A2A_2 dots\\dots ANA_N

It must satisfy all the requirements above.


Sample Input 1

6 3
1 4 3
2 2 1
4 6 2

Sample Output 1

0 1 1 1 0 1 

Another acceptable output is 1 1 0 1 1 0.
On the other hand, 0 1 1 1 1 1, which has more than the fewest number of 1s, is unacceptable.


Sample Input 2

8 2
2 6 1
3 5 3

Sample Output 2

0 0 1 1 1 0 0 0