#include <bits/stdc++.h>

using Int = int;
using namespace std;

#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
template<class T> T ant(const T &a, const T &b){ return a > b ? a : b; };
template<class T> T ont(const T &a, const T &b){ return a < b ? a : b; };
template<class T> T th(T &a, const T &b, T (*f)(const T &, const T &)){ return a = f(a, b); }
#define anth(a, b) th(a, b, ant)
#define onth(a, b) th(a, b, ont)

int main(){
	Int n, m;
	cin >> n >> m;
	vector<pair<Int, Int>> robot(m);
	RC(i, m) cin >> robot[i].first >> robot[i].second;
	sort(robot.begin(), robot.end());

	Int ans[n][2];

	RC(i, n){
		ans[i][0] = i;
		ans[i][1] = i + 1;
	}

	RC(i, m){
		onth(ans[robot[i].second][0], ans[robot[i].second - 1][0]);
		anth(ans[robot[i].second - 1][1], ans[robot[i].second][1]);

		/*
		RC(i, n){
			cout << ans[i][0] << ' ' << ans[i][1] << endl;
		}
		cout << endl;
		*/

	}
	RC(i, n){
		cout << ans[i][1] - ans[i][0] << " \n"[i == n - 1];
	}
}


### 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 <bits/stdc++.h>

using Int = int;
using namespace std;

#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
template<class T> T ant(const T &a, const T &b){ return a > b ? a : b; };
template<class T> T ont(const T &a, const T &b){ return a < b ? a : b; };
template<class T> T th(T &a, const T &b, T (*f)(const T &, const T &)){ return a = f(a, b); }
#define anth(a, b) th(a, b, ant)
#define onth(a, b) th(a, b, ont)

int main(){
	Int n, m;
	cin >> n >> m;
	vector<pair<Int, Int>> robot(m);
	RC(i, m) cin >> robot[i].first >> robot[i].second;
	sort(robot.begin(), robot.end());

	Int ans[n][2];

	RC(i, n){
		ans[i][0] = i;
		ans[i][1] = i + 1;
	}

	RC(i, m){
		onth(ans[robot[i].second][0], ans[robot[i].second - 1][0]);
		anth(ans[robot[i].second - 1][1], ans[robot[i].second][1]);

		/*
		RC(i, n){
			cout << ans[i][0] << ' ' << ans[i][1] << endl;
		}
		cout << endl;
		*/

	}
	RC(i, n){
		cout << ans[i][1] - ans[i][0] << " \n"[i == n - 1];
	}
}


```