#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;
}