#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

int main() {
    int n, m;
    cin >> n >> m;
    int a[n][2];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 2; j++) {
            a[i][j] = i;
        }
    }
    pii pos[m];
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >> x >> y;
        pos[i] = pii(x, y);
    }
    sort(pos, pos + m);
    for (int i = 0; i < m; i++) {
        int crane = pos[i].second;
        a[crane][0] = a[crane - 1][0];
        a[crane - 1][1] = a[crane][1]; 
    }
    for (int i = 0; i < n; i++) {
        cout << a[i][1] - a[i][0] + 1;
        if (i != n - 1) {
            cout << " ";
        }
    }
    cout << endl;
}


### Prompt

In CPP, your task is to solve the following problem:

Example

Input

4 3
1000 1
2000 2
3000 3


Output

2 3 4 4

### Response

```cpp
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

int main() {
    int n, m;
    cin >> n >> m;
    int a[n][2];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 2; j++) {
            a[i][j] = i;
        }
    }
    pii pos[m];
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >> x >> y;
        pos[i] = pii(x, y);
    }
    sort(pos, pos + m);
    for (int i = 0; i < m; i++) {
        int crane = pos[i].second;
        a[crane][0] = a[crane - 1][0];
        a[crane - 1][1] = a[crane][1]; 
    }
    for (int i = 0; i < n; i++) {
        cout << a[i][1] - a[i][0] + 1;
        if (i != n - 1) {
            cout << " ";
        }
    }
    cout << endl;
}


```