There are N villages beside the highway between Almaty and Taraz, numbered 1 to N. When winter began, M traders started selling knitted hats in these villages. Every trader keeps two rules: he trades in one village for a single day, and he raises his price every day.
Trader i behaves like this.
He starts trading in village Li at price Xi.
Every day he moves to the next village. If he traded in village j yesterday, he trades in village j+1 today.
Every day he raises the price by 1. If yesterday's price was x, today's price is x+1.
He stops once he has sold his hats in village Ri.
For each village, find the highest price that was ever asked there.
Input
The first line contains the number of villages N and the number of traders M (1≤N≤300000, 1≤M≤300000).
Each of the next M lines contains three integers Li, Ri, Xi (1≤Li≤Ri≤N, 1≤Xi≤109): the first village, the last village, and the starting price of trader i, in that order.
Output
Print N integers on one line, separated by single spaces. The i-th number is the highest price ever asked in village i. Print 0 for a village where nobody traded.