#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<int> cnt(m, 0);
    for (int i = 0; i < n; ++i) {
        int l;
        cin >> l;
        --l;
        ++cnt[l];
    }

    for (int i = 0; i < m; ++i) {
        cout << i + 1 << " " << cnt[i] << "\n";
    }
    return 0;
}