Trading
There are small villages close to the highway between Almaty and Taraz numbered from to . At the beginning of the winter unknown traders began trading knitted hats in these villages. They have only two rules: never trade in one place more than once (one day) and increase the price on hats each day.
More formally, each -th trader:
begins trading in village with starting price .
each day he moves to the next adjacent village, i.e. if he was trading in village yesterday, then today he is trading in village .
each day he increases the price by , so if yesterday's price was , then today's price is .
stops trading at village (after he traded his knitted hats in village ).
The problem is for each village to determine the maximal price that was there during the whole trading history.
Input
Each line contains two integers and — the number of villages and traders accordingly.
Each of the next lines contains three integers: and — the numbers of the first and the last village and starting price for the -th trader.
Output
Output integer numbers separating them with spaces — -th number being the maximal price for the trading history of -th village. If there was no trading in some village, output for it.