#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int* contar = new int[n];
for (int i = 0; i < n; ++i) {
int producto_id;
cin >> producto_id;
contar[producto_id]++;
}
for (int i = 0; i < n; ++i) {
if (contar[i] >= m) {
cout << i << " " << contar[i] << endl;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgbiwgbTsKICAgIGNpbiA+PiBuID4+IG07CgogICAgaW50KiBjb250YXIgPSBuZXcgaW50W25dOwoKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICAgICAgaW50IHByb2R1Y3RvX2lkOwogICAgICAgIGNpbiA+PiBwcm9kdWN0b19pZDsKICAgICAgICBjb250YXJbcHJvZHVjdG9faWRdKys7CiAgICB9CgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyArK2kpIHsKICAgICAgICBpZiAoY29udGFyW2ldID49IG0pIHsKICAgICAgICAgICAgY291dCA8PCBpIDw8ICIgIiA8PCBjb250YXJbaV0gPDwgZW5kbDsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gMDsKfQ==