#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>

#define MAX 20000010
#define min(a,b) ((a)<(b) ? (a):(b))
#define max(a,b) ((a)>(b) ? (a):(b))
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)

int n, m, L[MAX], R[MAX], Q[MAX];

int main(){
    int i, j, k, l, x, y;

    while (scanf("%d %d", &n, &m) != EOF){
        clr(Q);
        while (m--){
            scanf("%d %d", &x, &y);
            Q[x] = y;
        }

        for (i = 0; i < MAX; i++) L[i] = R[i] = i;
        for (i = 0; i < MAX; i++){
            if (Q[i]){
                k = Q[i], l = Q[i] + 1;
                L[k] = L[l] = min(L[k], L[l]);
                R[k] = R[l] = max(R[k], R[l]);
            }
        }

        for (i = 1; i <= n; i++){
            if (i > 1) putchar(32);
            printf("%d", R[i] - L[i] + 1);
        }
        puts("");
    }
    return 0;
}