#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;
const long double PI = acos((long double)(-1));

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;



int main()
{
    /*
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    */

    int n, m; scanf("%d %d", &n, &m);
    vector<pair<int, int>> vp(m);
    for (int i = 0; i < m; i++) {
        scanf("%d %d", &vp[i].first, &vp[i].second);
        vp[i].second--;
    }
    sort(vp.begin(), vp.end());
    vector<int> l(n), r(n); for (int i = 0; i < n; i++) l[i] = i, r[i] = i;
    for (int i = 0; i < m; i++) {
        r[vp[i].second] = r[vp[i].second + 1];
        l[vp[i].second + 1] = l[vp[i].second];
    }
    for (int i = 0; i < n; i++) printf("%d%c", r[i] - l[i] + 1, " \n"[i + 1 == n]);
    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 <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;
const long double PI = acos((long double)(-1));

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;



int main()
{
    /*
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    */

    int n, m; scanf("%d %d", &n, &m);
    vector<pair<int, int>> vp(m);
    for (int i = 0; i < m; i++) {
        scanf("%d %d", &vp[i].first, &vp[i].second);
        vp[i].second--;
    }
    sort(vp.begin(), vp.end());
    vector<int> l(n), r(n); for (int i = 0; i < n; i++) l[i] = i, r[i] = i;
    for (int i = 0; i < m; i++) {
        r[vp[i].second] = r[vp[i].second + 1];
        l[vp[i].second + 1] = l[vp[i].second];
    }
    for (int i = 0; i < n; i++) printf("%d%c", r[i] - l[i] + 1, " \n"[i + 1 == n]);
    return 0;
}

```