Pro is a painter. He is also pro in sports programming.
He got a contract for painting a wall of a house. The wall is divided into N segments all initially colored with 0. He has to color the segments according to the demands of the family members.
In total, there will be Q demands to color segment [L, R] with color C. These will be sequential, so Pro has to fulfill them in the order given.
Pro is not worried about the demands, however, he is curious about the color of each segment, so he asks for your help.
1 <= N <= 100000
1 <= Q <= 100000
1 <= L <= R <= 100000
1 <= C <= 1000000000
First-line contains two integers N (number of segments of the wall)
Second-line contains Q (total demands) Next, Q lines will be having Li, Ri, Ci (segment Li to Ri, has to be colored with color Ci)
Print a single line with space-separated N integers, representing the color of N segments after all demands are fulfilled.
Sample Test Case 1
2 5 777
1 3 34
34 34 34 777 777
After first demand: 0 777 777 777 777
After second demand: 34 34 34 777 777