#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define REP(i,n) for (int i=0; i<n; i++)

int main(){
  int n, m, x, y, a0, a1, b0, b1;
  cin >> n >> m;
  
  vector<pair<int, int> > robots(m);
  vector<pair<int, int> > lanes(n);
  pair<int, int> newbounds;
  
  REP(i,n){
    lanes[i] = make_pair(i, i+1);
//    printf("(%d, %d)\n", lanes[i].first, lanes[i].second);
  }
  
  REP(i,m){
    cin >> x >> y;
    y--;
    robots[i] = make_pair(x, y);
  }
  
  sort(robots.begin(), robots.end());
//  REP(i,m){
//    printf("robots[%d] = (%d, %d)\n", i, robots[i].first, robots[i].second);
//  }
  
  REP(i,m){
    y = robots[i].second;
    a0 = lanes[y].first;
    a1 = lanes[y+1].first;
    b0 = lanes[y].second;
    b1 = lanes[y+1].second;
//    printf("y=%d, 0: (%d, %d), 1: (%d, %d)\n", y, a0, b0, a1, b1);
    newbounds = make_pair(min(a0, a1), max(b0, b1));
    lanes[y] = newbounds;
    lanes[y+1] = newbounds;
  }
  
  REP(i,n){
    printf("%d", lanes[i].second - lanes[i].first);
    if (i<n-1){
      printf(" ");
    }
  }
  printf("\n");
  
  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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define REP(i,n) for (int i=0; i<n; i++)

int main(){
  int n, m, x, y, a0, a1, b0, b1;
  cin >> n >> m;
  
  vector<pair<int, int> > robots(m);
  vector<pair<int, int> > lanes(n);
  pair<int, int> newbounds;
  
  REP(i,n){
    lanes[i] = make_pair(i, i+1);
//    printf("(%d, %d)\n", lanes[i].first, lanes[i].second);
  }
  
  REP(i,m){
    cin >> x >> y;
    y--;
    robots[i] = make_pair(x, y);
  }
  
  sort(robots.begin(), robots.end());
//  REP(i,m){
//    printf("robots[%d] = (%d, %d)\n", i, robots[i].first, robots[i].second);
//  }
  
  REP(i,m){
    y = robots[i].second;
    a0 = lanes[y].first;
    a1 = lanes[y+1].first;
    b0 = lanes[y].second;
    b1 = lanes[y+1].second;
//    printf("y=%d, 0: (%d, %d), 1: (%d, %d)\n", y, a0, b0, a1, b1);
    newbounds = make_pair(min(a0, a1), max(b0, b1));
    lanes[y] = newbounds;
    lanes[y+1] = newbounds;
  }
  
  REP(i,n){
    printf("%d", lanes[i].second - lanes[i].first);
    if (i<n-1){
      printf(" ");
    }
  }
  printf("\n");
  
  return 0;
}

```