Trading#7482

Trading

1 second
128 megabytes
Very easy

Along the Almaty - Taraz highway, there are villages, numbered from to . With the arrival of winter, unknown traders brought knitted hats from a certain aul and began selling them in these villages. The traders follow two principles:

More formally, each -th trader:

For each village, determine the maximum price of a single hat throughout the entire trading history.

Input

The first line contains two integers n~(1 \le n \le 3 \cdot 10^5) and m~(1 \le m \le 3 \cdot 10^5) — the number of villages and the number of traders, respectively.

The next lines each contain three integers: l_i, r_i~(1 \le l_i \le r_i \le n) and x_i~(1 \le x_i \le 10^9) — the starting and ending villages, as well as the initial price of a hat for the -th trader.

Output

Print integers, where the -th number represents the maximum price of a hat throughout the entire trading history in the -th village. If no trade took place in a particular village, print .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading