#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;

signed main(){
    
    int n, m; cin >> n >> m;
    vector<pair<int, int> > p;
    
    for(int i = 0; i < m; i++){ 
        int x, y; cin >> x >> y;
        y--;
        p.push_back({x, y});
    }
    
    sort(p.begin(), p.end());
    
    vector<int> L(n);
    vector<int> R(n);
    for(int i = 0; i < n; i++) L[i] = R[i] = i;
    
    for(int i = 0; i < m; i++){
        int y = p[i].second;
        L[y + 1] = L[y];
        R[y] = R[y + 1];    
    }

    for(int i = 0; i < n; i++){
        if(i != n - 1) cout << R[i] - L[i] + 1 << " ";
        else cout << R[i] - L[i] + 1 << endl;
    }

    return 0;
}


### Prompt

Your task is to create a cpp solution to the following problem:

Example

Input

4 3
1000 1
2000 2
3000 3


Output

2 3 4 4

### Response

```cpp
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;

signed main(){
    
    int n, m; cin >> n >> m;
    vector<pair<int, int> > p;
    
    for(int i = 0; i < m; i++){ 
        int x, y; cin >> x >> y;
        y--;
        p.push_back({x, y});
    }
    
    sort(p.begin(), p.end());
    
    vector<int> L(n);
    vector<int> R(n);
    for(int i = 0; i < n; i++) L[i] = R[i] = i;
    
    for(int i = 0; i < m; i++){
        int y = p[i].second;
        L[y + 1] = L[y];
        R[y] = R[y + 1];    
    }

    for(int i = 0; i < n; i++){
        if(i != n - 1) cout << R[i] - L[i] + 1 << " ";
        else cout << R[i] - L[i] + 1 << endl;
    }

    return 0;
}


```