#00072A

podnizovi

Reconstruct the array if you're given some sums of sub-arrays of consecutive elements. All the elements must be natural numbers not larger than 10 ^ 9. If there exist more than one solution you should output any solution.



InputIn the first line of input there are two numbers N i Q (1 ≤ N ≤ 1000, Q ≤ N * (N -1) / 2), number of the elements of the array and number of the known sums. In the following Q lines there are three numbers L, R and S which represent that the sum of elements A[L] + A[L +1] + ... + A[R - 1] + A[R] = S. (1 ≤ L < R ≤ N, 1 ≤ S ≤ 10 ^ 12).

NOTE: The solution will always exist.


OutputOn the first line you should output the array with elements separated by a single space.


Input:
5 3
1 3 9
3 4 10
1 5 100

Output:
3 1 5 5 86

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.