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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  int n,m;
  cin >> n >> m;
  vector<pair<int,int>> p(m);
  rep(i,m){
    cin >> p[i].first >> p[i].second;
  }
  sort(all(p));
  vector<pair<int,int>> r(n);
  rep(i,n){
    r[i]={i,i};
  }
  rep(i,m){
    int k = p[i].second-1;
    r[k]=r[k+1]={r[k].first,r[k+1].second};
  }
  rep(i,n){
    cout << r[i].second-r[i].first+1;
    if(i<n-1) cout << " ";
    else 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>
using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  int n,m;
  cin >> n >> m;
  vector<pair<int,int>> p(m);
  rep(i,m){
    cin >> p[i].first >> p[i].second;
  }
  sort(all(p));
  vector<pair<int,int>> r(n);
  rep(i,n){
    r[i]={i,i};
  }
  rep(i,m){
    int k = p[i].second-1;
    r[k]=r[k+1]={r[k].first,r[k+1].second};
  }
  rep(i,n){
    cout << r[i].second-r[i].first+1;
    if(i<n-1) cout << " ";
    else cout << endl;
  }
  return 0;
}


```