#include char buf[2000000]; char *p = buf; int ru() { int r = 0; while (*p < '0' || *p > '9') p++; while (*p >= '0' && *p <= '9') r = r * 10 + *p++ - '0'; return r; } void write(int x) { // x >= 0 static char tmp[10]; char *tmpp = tmp; if (!x) *tmpp++ = '0'; while (x) *tmpp++ = x % 10 + '0', x /= 10; while (tmpp > tmp) *p++ = *--tmpp; } int main() { fread(buf, sizeof(buf), 1, stdin); int n = ru(); int m = ru(); int res[m + 1] = { 0 }; for (int i = 0; i < n; i++) { int x = ru(); if (x <= m) res[x]++; } p = buf; for (int i = 1; i <= m; i++) { write(i); *p++ = ' '; write(res[i]); *p++ = '\n'; } fwrite(buf, 1, p - buf, stdout); return 0; }