#include <bits/stdc++.h>

using namespace std;

#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)

typedef pair<int, int> P;

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int n, m; cin >> n >> m;
  vector<P> robot;
  rep(i, m) {
    int x, y; cin >> x >> y;
    robot.emplace_back(x, y);
  }
  sort(all(robot));
  
  vector<int> l(n), h(n);
  rep(i, n) l[i] = h[i] = i;
  for(auto &p : robot) {
    int x, y; tie(x, y) = p;
    l[y] = l[y-1];
    h[y-1] = h[y];
  }

  rep(i, n) cout << h[i]-l[i]+1 << (i==n-1 ? '\n' : ' ');
  
  return 0;
}
### Prompt

Please create a solution in Cpp 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;

#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)

typedef pair<int, int> P;

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int n, m; cin >> n >> m;
  vector<P> robot;
  rep(i, m) {
    int x, y; cin >> x >> y;
    robot.emplace_back(x, y);
  }
  sort(all(robot));
  
  vector<int> l(n), h(n);
  rep(i, n) l[i] = h[i] = i;
  for(auto &p : robot) {
    int x, y; tie(x, y) = p;
    l[y] = l[y-1];
    h[y-1] = h[y];
  }

  rep(i, n) cout << h[i]-l[i]+1 << (i==n-1 ? '\n' : ' ');
  
  return 0;
}
```