CSES - Line Segments Trace II
  • Time limit: 1.00 s
  • Memory limit: 512 MB

There are nn line segments whose endpoints have integer coordinates. Each x-coordinate is between 00 and mm. The slope of each segment is an integer.

For each x-coordinate 0,1,,m0,1,\dots,m, find the maximum point in any line segment. If there is no segment at some point, the maximum is 1-1.

Input

The first line has two integers nn and mm: the number of line segments and the maximum x-coordinate.

The next nn lines describe the line segments. Each line has four integers x1x_1, y1y_1, x2x_2 and y2y_2: there is a line segment between points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2).

Output

Print m+1m+1 integers: the maximum points for x=0,1,,mx=0,1,\dots,m.

Constraints

  • 1n,m1051 \le n, m \le 10^5
  • 0x1<x2m0 \le x_1 < x_2 \le m
  • 0y1,y21090 \le y_1,y_2 \le 10^9

Example

Input:

4 5
1 1 3 3
1 2 4 2
2 4 5 7
2 8 5 2

Output:

-1 2 8 6 6 7