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

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<" : "<<x<<endl
#define ALL(v) (v).begin(),(v).end()

int n,m;
int l[252521],r[252521];
pii e[125252];

int main(){
  scanf("%d%d",&n,&m);
  REP(i,n)l[i]=r[i]=i;
  REP(i,m){
    int o,p;
    scanf("%d%d",&o,&p);
    e[i] = pii(o,p-1);
  }
  sort(e,e+m);
  REP(i,m){
    int u = e[i].second;
    int v = u+1;
    l[v] = l[u];
    r[u] = r[v];
  }
  REP(i,n){
    printf("%d",r[i]-l[i]+1);
    if(i==n-1)putchar('\n');
    else putchar(' ');
  }
  return 0;
}
### 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 <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<" : "<<x<<endl
#define ALL(v) (v).begin(),(v).end()

int n,m;
int l[252521],r[252521];
pii e[125252];

int main(){
  scanf("%d%d",&n,&m);
  REP(i,n)l[i]=r[i]=i;
  REP(i,m){
    int o,p;
    scanf("%d%d",&o,&p);
    e[i] = pii(o,p-1);
  }
  sort(e,e+m);
  REP(i,m){
    int u = e[i].second;
    int v = u+1;
    l[v] = l[u];
    r[u] = r[v];
  }
  REP(i,n){
    printf("%d",r[i]-l[i]+1);
    if(i==n-1)putchar('\n');
    else putchar(' ');
  }
  return 0;
}
```