- Time limit: 1.00 s
- Memory limit: 512 MB
There is an array of numbers . Initially each array value is , but the array will be modified using operations.
Each operation consists of a range and a starting value . This means that becomes where .
Your task is to print the final array after all operations.
Input
The first input line has two integers and .
After this, there are lines that describe the operations. Each line has three values , and according to the problem statement.
Output
Print the final array.
Constraints
Example
Input:
8 2 1 6 1 5 7 100
Output:
1 2 3 4 100 101 102 0