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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll n,m;
ll l[200010],r[200010];
vector<P> ps;

int main(){
  cin>>n>>m;
  rep(i,m){
    ll x,y;
    cin>>x>>y;
    y--;
    ps.push_back(P(x,y));
  }
  sort(all(ps));
  rep(i,n)l[i]=r[i]=i;
  rep(i,m){
    l[ps[i].se+1]=l[ps[i].se];
    r[ps[i].se]=r[ps[i].se+1];
  }
  cout<<r[0]-l[0]+1;
  repl(i,1,n)cout<<" "<<r[i]-l[i]+1;
  cout<<endl;
  return 0;
}


### Prompt

Please formulate 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 <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll n,m;
ll l[200010],r[200010];
vector<P> ps;

int main(){
  cin>>n>>m;
  rep(i,m){
    ll x,y;
    cin>>x>>y;
    y--;
    ps.push_back(P(x,y));
  }
  sort(all(ps));
  rep(i,n)l[i]=r[i]=i;
  rep(i,m){
    l[ps[i].se+1]=l[ps[i].se];
    r[ps[i].se]=r[ps[i].se+1];
  }
  cout<<r[0]-l[0]+1;
  repl(i,1,n)cout<<" "<<r[i]-l[i]+1;
  cout<<endl;
  return 0;
}


```