CSES - HIIT Open 2019 - Final Array
  • Time limit: 1.00 s
  • Memory limit: 512 MB

There is an array AA of nn numbers A[1],A[2],,A[n]A[1],A[2],\dots,A[n]. Initially each array value is 00, but the array will be modified using mm operations.

Each operation consists of a range [a,b][a,b] and a starting value xx. This means that A[a+k]A[a+k] becomes max(A[a+k],x+k)\max(A[a+k],x+k) where k=0,1,,bak=0,1,\dots,b-a.

Your task is to print the final array after all operations.

Input

The first input line has two integers nn and mm.

After this, there are mm lines that describe the operations. Each line has three values aa, bb and xx according to the problem statement.

Output

Print the final array.

Constraints

  • 1n,m1051 \le n, m \le 10^5
  • 1abn1 \le a \le b \le n
  • 1x1091 \le x \le 10^9

Example

Input:

8 2
1 6 1
5 7 100

Output:

1 2 3 4 100 101 102 0