#include<bits/stdc++.h>
using namespace std;
#define P pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define PB push_back
#define F first
#define S second


int n,m;
int l[200000],r[200000];

signed main(){
  cin>>n>>m;
  vector<P> v(m);
  rep(i,m){
    int x,y;
    cin>>x>>y;
    y--;
    v[i]=P(x,y);
  }

  rep(i,n){
    l[i]=i;
    r[i]=i;
  }

  sort(all(v));

  rep(i,m){
    int x=v[i].S;
    r[x]=r[x+1];
    l[x+1]=l[x];
  }

  rep(i,n){
    if(i) cout<<' ';
    cout<<r[i]-l[i]+1;
  }
  cout<<endl;

}


### Prompt

Develop a solution in CPP to the problem described below:

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 P pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define PB push_back
#define F first
#define S second


int n,m;
int l[200000],r[200000];

signed main(){
  cin>>n>>m;
  vector<P> v(m);
  rep(i,m){
    int x,y;
    cin>>x>>y;
    y--;
    v[i]=P(x,y);
  }

  rep(i,n){
    l[i]=i;
    r[i]=i;
  }

  sort(all(v));

  rep(i,m){
    int x=v[i].S;
    r[x]=r[x+1];
    l[x+1]=l[x];
  }

  rep(i,n){
    if(i) cout<<' ';
    cout<<r[i]-l[i]+1;
  }
  cout<<endl;

}


```