#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }






int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    
    int n, m;
    while (cin >> n && n) {
        cin >> m;
        vector<pii> p(100111);
        vector<int> l(200111), r(200111);
        rep(i, m) { cin >> p[i].F >> p[i].S; p[i].S--; }
        sort(p.begin(), p.begin() + m);
        
        rep(i, n) l[i] = r[i] = i;
        rep(i, m) {
            int y = p[i].S;
            r[y] = r[y + 1];
            l[y + 1] = l[y];
            // cout << endl; rep(_, n) cout << l[_] << " "; cout << endl;
            // rep(_, n) cout << r[_] << " "; cout << endl;
        }
        rep(i, n) cout << r[i] - l[i] + 1 << (i == n - 1 ? '\n' : ' ');
    }
}





### Prompt

Create a solution in CPP for 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;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }






int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    
    int n, m;
    while (cin >> n && n) {
        cin >> m;
        vector<pii> p(100111);
        vector<int> l(200111), r(200111);
        rep(i, m) { cin >> p[i].F >> p[i].S; p[i].S--; }
        sort(p.begin(), p.begin() + m);
        
        rep(i, n) l[i] = r[i] = i;
        rep(i, m) {
            int y = p[i].S;
            r[y] = r[y + 1];
            l[y + 1] = l[y];
            // cout << endl; rep(_, n) cout << l[_] << " "; cout << endl;
            // rep(_, n) cout << r[_] << " "; cout << endl;
        }
        rep(i, n) cout << r[i] - l[i] + 1 << (i == n - 1 ? '\n' : ' ');
    }
}





```