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

int main() {
    int n, m;
    cin >> n >> m;

    vector<int> graph[n];

    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;

        graph[u].push_back(v);
        graph[v].push_back(u);
    }

    for (int i = 0; i < n; i++) {
        int degree = graph[i].size();
        cout << i << " " << degree << "\n";
    }

    return 0;
}