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 ws 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.
The first line contains two integers n, w (1≤n≤2⋅105, 1≤w≤107) --- the number of files and wire's throughput.
Each of the next n lines contains three integers t_i, s_i, p_i (1≤t_i≤107, 1≤s_i≤107, 1≤p_i≤100) --- start time of the transfer, size and priority.
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.