#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<limits>
#include<bitset>
#include<numeric>
#include<unordered_map>
#include<functional>
using namespace std;

#define rep(i,s,n) for(int i=s;i<n;i++)
#define dow(i,n,s) for(int i=n-1;i>=s;i--)
#define all(a) a.begin(),a.end()
#define Sort(a) sort(all(a))
//#define rng(a,b,e) a.begin()+b,a.begin()+e
#define Qsort(a,size) qsort(a,size,sizeof(*a),compare_int)
#define DEBUG
typedef pair<int,int> II;
typedef pair<double,double> DD;
typedef pair<int,string> IS;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;

const int INF = 1e+9;
const int MAX_N = 2e+5;
const int MAX_M = 1e+5;

int n,m; //n ... レーン数，m ... ロボット数
II line[MAX_N];
vector<II> robot;

//void solve();
bool compare_by_second(II a,II b) {
  if(a.second != b.second) return a.second<b.second;
  else return a.first<b.first;
}
bool compare_int(const void *a,const void *b) { return *(int *)a - *(int *)b; }

int main() {

  cin>>n>>m;
  rep(i,0,n) line[i].first = line[i].second = i;
  robot.resize(m);
  rep(i,0,m) cin>>robot[i].first>>robot[i].second;
  sort(all(robot));
  rep(i,0,m) {
    //robot[i].secondについて
    line[robot[i].second-1].second = line[robot[i].second-1].second < line[robot[i].second].second ? line[robot[i].second].second : line[robot[i].second-1].second;
    //robot[i].second+1について
    line[robot[i].second].first = line[robot[i].second-1].first < line[robot[i].second].first ? line[robot[i].second-1].first : line[robot[i].second].first;
  }

  cout<<(line[0].second - line[0].first+1);
  rep(i,1,n) cout<<" "<<(line[i].second - line[i].first+1);
  cout<<endl;
  return 0;
}


### 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<iostream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<limits>
#include<bitset>
#include<numeric>
#include<unordered_map>
#include<functional>
using namespace std;

#define rep(i,s,n) for(int i=s;i<n;i++)
#define dow(i,n,s) for(int i=n-1;i>=s;i--)
#define all(a) a.begin(),a.end()
#define Sort(a) sort(all(a))
//#define rng(a,b,e) a.begin()+b,a.begin()+e
#define Qsort(a,size) qsort(a,size,sizeof(*a),compare_int)
#define DEBUG
typedef pair<int,int> II;
typedef pair<double,double> DD;
typedef pair<int,string> IS;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;

const int INF = 1e+9;
const int MAX_N = 2e+5;
const int MAX_M = 1e+5;

int n,m; //n ... レーン数，m ... ロボット数
II line[MAX_N];
vector<II> robot;

//void solve();
bool compare_by_second(II a,II b) {
  if(a.second != b.second) return a.second<b.second;
  else return a.first<b.first;
}
bool compare_int(const void *a,const void *b) { return *(int *)a - *(int *)b; }

int main() {

  cin>>n>>m;
  rep(i,0,n) line[i].first = line[i].second = i;
  robot.resize(m);
  rep(i,0,m) cin>>robot[i].first>>robot[i].second;
  sort(all(robot));
  rep(i,0,m) {
    //robot[i].secondについて
    line[robot[i].second-1].second = line[robot[i].second-1].second < line[robot[i].second].second ? line[robot[i].second].second : line[robot[i].second-1].second;
    //robot[i].second+1について
    line[robot[i].second].first = line[robot[i].second-1].first < line[robot[i].second].first ? line[robot[i].second-1].first : line[robot[i].second].first;
  }

  cout<<(line[0].second - line[0].first+1);
  rep(i,1,n) cout<<" "<<(line[i].second - line[i].first+1);
  cout<<endl;
  return 0;
}


```