#include <iostream>
using namespace std;
#include <bits/stdc++.h>
#include<vector>
int main() {
// your code goes here
int n,m;
cin>>n>>m;
vector<int>g[n];
for(int i=1;i<=m;i++)
{
int x,y;
cin>>x>>y;
g[x].push_back(y);
g[y].push_back(x);
}
for(int i=0;i<n;i++)
{
int c = g[i].size();
cout<<i<<" "<<c<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8dmVjdG9yPgoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglpbnQgbixtOwoJY2luPj5uPj5tOwoJdmVjdG9yPGludD5nW25dOwoJZm9yKGludCBpPTE7aTw9bTtpKyspCgkgewoJIAlpbnQgeCx5OwoJIAljaW4+Png+Pnk7CgkgCWdbeF0ucHVzaF9iYWNrKHkpOwoJIAlnW3ldLnB1c2hfYmFjayh4KTsKCSB9CgkgCgkgZm9yKGludCBpPTA7aTxuO2krKykKCSAgewoJICAJaW50IGMgPSBnW2ldLnNpemUoKTsKCSAgCWNvdXQ8PGk8PCIgIjw8Yzw8ZW5kbDsKCSAgfQoJcmV0dXJuIDA7Cn0=