#include<bits/stdc++.h>
using namespace std;

int N;
int M;
int t[200001];
int b[200001];
int main(){
	cin >> N >> M;
	for(int i = 0; i < N; i++){
		t[i] = 0;
		b[i] = 0;
	}

	vector<pair<int, int> > arms(M);
	for(int i = 0; i < M; i++){
		int a,b;
		cin >> a >> b;
		arms[i] = {a, b};
	}

	sort(arms.begin(), arms.end());

	for(auto arm : arms){
		t[arm.second] = t[arm.second - 1] + 1;
		b[arm.second - 1] = b[arm.second] + 1;
	}

	for(int i = 0; i < N; i++){
		if(i) cout << " ";
		cout << (t[i] + b[i] + 1);
	}
	cout << endl;
}
### 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>
using namespace std;

int N;
int M;
int t[200001];
int b[200001];
int main(){
	cin >> N >> M;
	for(int i = 0; i < N; i++){
		t[i] = 0;
		b[i] = 0;
	}

	vector<pair<int, int> > arms(M);
	for(int i = 0; i < M; i++){
		int a,b;
		cin >> a >> b;
		arms[i] = {a, b};
	}

	sort(arms.begin(), arms.end());

	for(auto arm : arms){
		t[arm.second] = t[arm.second - 1] + 1;
		b[arm.second - 1] = b[arm.second] + 1;
	}

	for(int i = 0; i < N; i++){
		if(i) cout << " ";
		cout << (t[i] + b[i] + 1);
	}
	cout << endl;
}
```