Dohyun has N baskets, and the baskets are numbered 1 through N in order. The baskets stand in one row. The leftmost basket is at position 1, the next one at position 2, and so on up to position N at the right end.
Dohyun rotates the basket order M times. For each rotation he picks the range to rotate, then picks one basket inside that range as the pivot. If the ends of the chosen range are begin and end and the pivot sits at position mid, then the baskets that stood in the order begin,begin+1,…,mid−1,mid,mid+1,…,end−1,end end up in the order mid,mid+1,…,end−1,end,begin,begin+1,…,mid−1.
Given the rotations, write a program that performs all M of them and prints the number written on each basket, starting from the leftmost one.
The first line contains N (1≤N≤100) and M (1≤M≤100).
Each of the next M lines contains one rotation as three integers i, j, k. It means the order of the baskets from position i to position j counted from the left is rotated, and the pivot is the basket at position k. (1≤i≤k≤j≤N)
Dohyun applies the rotations in the order they are given.
After all rotations, print the number written on each basket from the leftmost one, on one line, separated by single spaces.