#include <iostream>
using namespace std;
int main() {
int numProd, cantMin, i, cod;
cin >> numProd >> cantMin;
int prod[numProd+1] = {0};
for (i=1; i<=numProd; i++){
cin >> cod;
prod[cod]++;
}
for (i=0; i<=numProd; i++){
if (prod[i] >= cantMin) cout << i << ' ' << prod[i] << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbnVtUHJvZCwgY2FudE1pbiwgaSwgY29kOwoJY2luID4+IG51bVByb2QgPj4gY2FudE1pbjsKCWludCBwcm9kW251bVByb2QrMV0gPSB7MH07Cglmb3IgKGk9MTsgaTw9bnVtUHJvZDsgaSsrKXsKCQljaW4gPj4gY29kOwoJCXByb2RbY29kXSsrOwoJfQoJZm9yIChpPTA7IGk8PW51bVByb2Q7IGkrKyl7CgkJaWYgKHByb2RbaV0gPj0gY2FudE1pbikgY291dCA8PCBpIDw8ICcgJyA8PCBwcm9kW2ldIDw8IGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==