p00948 Distribution Center
Example

Input

4 3
1000 1
2000 2
3000 3


Output

2 3 4 4
```python
N,M = map(int,input().split())
XY = []
for _ in range(M):
    x,y = map(int,input().split())
    xy = (x,y)
    XY.append(xy)
XY.sort(key = lambda x:x[0]) # x sort

*minY, = range(N)
*maxY, = range(N)

for _,y in XY:
    y0,y1 = y-1, y
    minY[y1] = minY[y0]
    maxY[y0] = maxY[y1]


ans = [maxY[i] - minY[i]+1 for i in range(N)]
print(*ans)

```