#include <bits/stdc++.h>
using namespace std;

int graph[10000][10000];

int main() {
	int n, m;
	cin >> n >> m;
	
	for(int i=0; i<m; i++) {
		// taking input of undirected graph
		int x, y;
		cin >> x >> y;
		
		graph[x][y] = 1;
		graph[y][x] = 1;
	}
	
	for(int i=0; i<n; i++) {
		int c = 0;
		for(int j=0; j<n; j++) {
			if(graph[i][j] == 1) {
				c++;
			}
		}
		cout << i << " " << c << endl;
	}
	return 0;
}