#include <iostream>
using namespace std;
struct asd {
int wsk;
int count;
asd() {wsk=0;count=0;}
};
int main() {
int data[50];
asd lista[50];
int i=0,how_many=0;
while (cin >> data[i]) {
how_many++;
for(int j=0;j<how_many;j++) {
//if a number happens to be first of its kind
if(lista[j].wsk==0 && lista[j].count == 0) {lista[j].wsk=data[i];lista[j].count++; break;}
else if (lista[j].wsk== data[i]) {lista[j].count++; break;}
}
++i; //must be here, else It'd assign some random memory adress (cause it would point to thing that hasnt been yet processed)
}
for(int p=0;p<how_many;p++)
cout << lista[p].wsk << " " << lista[p].count <<"\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpzdHJ1Y3QgYXNkIHsKCWludCB3c2s7CglpbnQgY291bnQ7Cglhc2QoKSB7d3NrPTA7Y291bnQ9MDt9Cn07CmludCBtYWluKCkgewoJaW50IGRhdGFbNTBdOwoJYXNkIGxpc3RhWzUwXTsKCWludCBpPTAsaG93X21hbnk9MDsKCXdoaWxlIChjaW4gPj4gZGF0YVtpXSkgewoJCWhvd19tYW55Kys7CgkKCQoJCWZvcihpbnQgaj0wO2o8aG93X21hbnk7aisrKSB7CgkJCS8vaWYgYSBudW1iZXIgaGFwcGVucyB0byBiZSBmaXJzdCBvZiBpdHMga2luZAoJCQlpZihsaXN0YVtqXS53c2s9PTAgJiYgbGlzdGFbal0uY291bnQgPT0gMCkJIHtsaXN0YVtqXS53c2s9ZGF0YVtpXTtsaXN0YVtqXS5jb3VudCsrOyBicmVhazt9CgkJCWVsc2UgaWYgKGxpc3RhW2pdLndzaz09IGRhdGFbaV0pIAkJCSB7bGlzdGFbal0uY291bnQrKzsgYnJlYWs7fSAKCQl9CgkJKytpOyAvL211c3QgYmUgaGVyZSwgZWxzZSBJdCdkIGFzc2lnbiBzb21lIHJhbmRvbSBtZW1vcnkgYWRyZXNzIChjYXVzZSBpdCB3b3VsZCBwb2ludCB0byB0aGluZyB0aGF0IGhhc250IGJlZW4geWV0IHByb2Nlc3NlZCkKCX0KCWZvcihpbnQgcD0wO3A8aG93X21hbnk7cCsrKQoJY291dCA8PCBsaXN0YVtwXS53c2sgPDwgIiAiIDw8IGxpc3RhW3BdLmNvdW50IDw8IlxuIjsKCQkKCgkKCXJldHVybiAwOwp9