#include <iostream>
using namespace std;
int main() {
// your code goes here
int b[5][5]; // in worst case take b[n][n]
int n,m;
cin>>n>>m;
int x,y;
for(int i=1;i<=m;i++)
{
cin>>x>>y;
b[x][y]=1;
b[y][x]=1;
}
for(int i=0;i<n;i++)
{
int c=0;
for(int j=0;j<n;j++)
{
if(b[i][j]==1)
{
c++;
}
}
cout<<i<<" "<<c<<"\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglpbnQgYls1XVs1XTsgLy8gaW4gd29yc3QgY2FzZSB0YWtlIGJbbl1bbl0KCWludCBuLG07CgljaW4+Pm4+Pm07CglpbnQgeCx5OwoJZm9yKGludCBpPTE7aTw9bTtpKyspCgkgewoJIAljaW4+Png+Pnk7CgkgCWJbeF1beV09MTsKCSAJYlt5XVt4XT0xOwoJIH0KCSAKCSBmb3IoaW50IGk9MDtpPG47aSsrKQoJICB7CgkgIAlpbnQgYz0wOwoJICAJZm9yKGludCBqPTA7ajxuO2orKykKCSAgCSB7CgkgIAkgCWlmKGJbaV1bal09PTEpCgkgIAkgCSB7CgkgIAkgCSAJYysrOwoJICAJIAkgfQoJICAJIAkKCSAgCSB9CgkgIAkgIGNvdXQ8PGk8PCIgIjw8Yzw8IlxuIjsKCSAgfQoJcmV0dXJuIDA7Cn0=