#include #include void solve() { int n, m; std::cin >> n >> m; std::vector cnt(m, 0); while (n--) { int x; std::cin >> x; if (x > m) continue; ++cnt[--x]; } for (int i = 0; i < m; ++i) { std::cout << i + 1 << " " << cnt[i] << std::endl; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }