#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}

pair<int,int> bs[200000];

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,m; cin >> n >> m;
    for(int i=0;i<n;i++){
        bs[i].first=bs[i].second=i;
    }
    vector<pair<int,int>> v(m);
    for(int i=0;i<m;i++){
        cin >> v[i].first >> v[i].second;
    }
    sort(v.begin(), v.end());
    for(int i=0;i<m;i++){
        int x=v[i].second;
        bs[x-1].first=bs[x].first;
        bs[x].second=bs[x-1].second;
    }
    for(int i=0;i<n;i++){
        if(i)printf(" ");
        printf("%d",bs[i].first-bs[i].second+1);
    }
    printf("\n");
}


### Prompt

Please provide a Cpp coded solution to the problem described below:

Example

Input

4 3
1000 1
2000 2
3000 3


Output

2 3 4 4

### Response

```cpp
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}

pair<int,int> bs[200000];

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,m; cin >> n >> m;
    for(int i=0;i<n;i++){
        bs[i].first=bs[i].second=i;
    }
    vector<pair<int,int>> v(m);
    for(int i=0;i<m;i++){
        cin >> v[i].first >> v[i].second;
    }
    sort(v.begin(), v.end());
    for(int i=0;i<m;i++){
        int x=v[i].second;
        bs[x-1].first=bs[x].first;
        bs[x].second=bs[x-1].second;
    }
    for(int i=0;i<n;i++){
        if(i)printf(" ");
        printf("%d",bs[i].first-bs[i].second+1);
    }
    printf("\n");
}


```