#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0; }
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0; }

using pii=pair<int,int>;

inline pii vmerge(pii s,pii t){
	pii r;
	r.first=min(s.first,t.first);
	r.second=max(s.second,t.second);
	return r;
}
const int LIMIT=200000+10;
pii a[LIMIT];

int main(){
	int n,m; 
	cin >> n >> m;
	vector<pii> xy(m);
	rep(i,m) cin >> xy[i].first >> xy[i].second;
	sort(xy.begin(), xy.end());


	rep(i,LIMIT){
		a[i].first=i;		
		a[i].second=i;
	}

	rep(i,m) {
		int y = xy[i].second-1;
		pii ret=vmerge(a[y],a[y+1]);
		a[y] = a[y+1]= ret;
	}
	
	rep(i,n) cout << (i?" ":"") << a[i].second-a[i].first+1;
	cout << endl;
	return 0;
}
### Prompt

Create a solution in Cpp for the following problem:

Example

Input

4 3
1000 1
2000 2
3000 3


Output

2 3 4 4

### Response

```cpp
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0; }
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0; }

using pii=pair<int,int>;

inline pii vmerge(pii s,pii t){
	pii r;
	r.first=min(s.first,t.first);
	r.second=max(s.second,t.second);
	return r;
}
const int LIMIT=200000+10;
pii a[LIMIT];

int main(){
	int n,m; 
	cin >> n >> m;
	vector<pii> xy(m);
	rep(i,m) cin >> xy[i].first >> xy[i].second;
	sort(xy.begin(), xy.end());


	rep(i,LIMIT){
		a[i].first=i;		
		a[i].second=i;
	}

	rep(i,m) {
		int y = xy[i].second-1;
		pii ret=vmerge(a[y],a[y+1]);
		a[y] = a[y+1]= ret;
	}
	
	rep(i,n) cout << (i?" ":"") << a[i].second-a[i].first+1;
	cout << endl;
	return 0;
}
```