#include <iostream>
#include <queue>
#include <vector>
#include <cstdio>
#include <set>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)	
const int INF = 1e9;

int n, m;
int main(void){
	cin >> n >> m;
	vector<pair<int, int> > p;
	rep(i, m){
		int x, y; cin >> x >> y;
		y--;
		p.push_back(make_pair(x, y));
	}
	sort(p.begin(), p.end());

	vector<pair<int, int> > seg(n);
	rep(i, n){
		seg[i] = make_pair(i, i);
	}

	rep(i, p.size()){
		int nx = p[i].first, ny = p[i].second;
		// printf("ny %d\n", ny);
		int l = seg[ny].first;
		int r = seg[ny + 1].second;
		// printf("%d %d \n", l, r);
		seg[ny] = make_pair(l, r);
		seg[ny + 1] = make_pair(l, r);
	}

	rep(i, n){
		if(i != n - 1)printf("%d ", seg[i].second - seg[i].first + 1);
		else printf("%d\n", seg[i].second - seg[i].first + 1);
	}
	return 0;
}
### Prompt

In CPP, your task is to solve the following problem:

Example

Input

4 3
1000 1
2000 2
3000 3


Output

2 3 4 4

### Response

```cpp
#include <iostream>
#include <queue>
#include <vector>
#include <cstdio>
#include <set>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)	
const int INF = 1e9;

int n, m;
int main(void){
	cin >> n >> m;
	vector<pair<int, int> > p;
	rep(i, m){
		int x, y; cin >> x >> y;
		y--;
		p.push_back(make_pair(x, y));
	}
	sort(p.begin(), p.end());

	vector<pair<int, int> > seg(n);
	rep(i, n){
		seg[i] = make_pair(i, i);
	}

	rep(i, p.size()){
		int nx = p[i].first, ny = p[i].second;
		// printf("ny %d\n", ny);
		int l = seg[ny].first;
		int r = seg[ny + 1].second;
		// printf("%d %d \n", l, r);
		seg[ny] = make_pair(l, r);
		seg[ny + 1] = make_pair(l, r);
	}

	rep(i, n){
		if(i != n - 1)printf("%d ", seg[i].second - seg[i].first + 1);
		else printf("%d\n", seg[i].second - seg[i].first + 1);
	}
	return 0;
}
```