#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
signed main(){
int n; cin >> n;
int m; cin >> m;
vector<pair<int, int>> whohowmuch(m);
vector<int> ans(n, 0), lost(n, m);
vector<pair<int, int>> x(m);
for(int i=0; i<m; i++){
cin >> x[i].F >> x[i].S;
lost[x[i].S]= i;// index where yi ost, aka i
}
whohowmuch[m-1]= make_pair(x[m-1].F, 1);
for(int i = m-2; i>-1; i--){
int wi = x[i].F;
if(lost[wi] == m)
whohowmuch[i]= make_pair(wi, m-i);
else {
pair<int, int> contender = whohowmuch[lost[wi]];
int curdur = lost[wi]-i;
if(contender.S> curdur )whohowmuch[i]= contender;
else if(contender.S< curdur ) whohowmuch[i]= make_pair(wi, curdur);
else{
if(contender.F< x[i].F)whohowmuch[i]= contender;
else whohowmuch[i]= make_pair(wi, curdur);
}
}
}
for(int i=0; i<m; i++)ans[whohowmuch[i].F]++;
for(auto it: ans)cout << it << " ";
}