There are $$$n$$$ schoolchildren playing kickball on an infinite grid. Of course, everyone wants to be the kicker, so they plan to line up. However, they have not figured out how to make a line.
Instead of lining up in an orderly fashion, they wander around an infinite 2-d grid, doing the following every minute:
The $$$i$$$-th person enters the grid at the beginning of minute $$$t_i$$$, facing north, at position $$$(x_i, y_i)$$$. Since recess ends after $$$m$$$ minutes, you need to determine the location of each person at the beginning of minute $$$m$$$.
The first line contains two integers $$$n$$$ and $$$m$$$ — the number of people and the duration of recess ($$$1 \le n, m \le 1000$$$).
The next $$$n$$$ lines contain three integers $$$x_i, y_i,$$$ and $$$t_i$$$ each, the location and time at which each person joins $$$(1 \le x_i, y_i \le 10^8, 0 \le t_i \lt m)$$$.
It is guaranteed that $$$t_i \leq t_{i + 1}$$$ for all $$$1 \le i \lt n$$$.
Print $$$n$$$ lines consisting of two integers $$$x_i$$$ and $$$y_i$$$ — the location of the $$$i$$$-th person at the beginning of the $$$m$$$-th minute.
3 51 2 04 4 25 6 4
4 4 7 4 5 7
5 51 1 15 1 21 2 23 5 44 5 4
1 1 5 4 1 1 4 5 5 5
The first sample case is shown in the following images: