C. Network Transfer
time limit per test
2 seconds
memory limit per test
512 mebibytes
input
standard input
output
standard output

Maksim, a well-known computer scientist in the field of networking, came up with a new protocol that Ramazan suggested to call cerr_maksim.

For simplicity, let us say that there are two computers in the network, and they are connected with a wire of throughput $$$w$$$. Files are being transferred from the first computer to the second computer. Transferring a file of size $$$s$$$ takes $$$\frac{s}{w}$$$ seconds.

There are $$$n$$$ files to be transferred, each has a moment $$$t_i$$$ when it starts being transferred, size $$$s_i$$$ and priority $$$p_i$$$. If multiple files are being transferred simultaneously, then wire's throughput is divided between transfers proportionally to their priorities.

For each file, calculate the moment when it will reach the second computer.

Input

The first line contains two integers $$$n$$$, $$$w$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le w \le 10^7$$$) — the number of files and wire's throughput.

Each of the next $$$n$$$ lines contains three integers $$$t_i$$$, $$$s_i$$$, $$$p_i$$$ ($$$1 \le t_i \le 10^7$$$, $$$1 \le s_i \le 10^7$$$, $$$1 \le p_i \le 100$$$) — start time of the transfer, size and priority.

Output

Print $$$n$$$ real numbers, $$$i$$$-th number being the moment when the transfer of $$$i$$$-th file is completed.

Your answers will be considered correct if, for each of them, its absolute or relative error does not exceed $$$10^{-6}$$$.

Examples
Input
2 10
0 100 2
4 200 1
Output
13
30
Input
2 10
30 200 1
10 100 2
Output
50
20