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

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