Program pcount;
Type
sc=array [1..1000] of integer;
Var
s:sc;
i,j:integer;
n,x:longint;
f1,f2:text;
Begin
assign(f1,'pcount.in');
assign(f2,'pcount.out');
reset(f1);
rewrite(f2);
for i:=1 to 1000 do s[i]:=0;
readln(f1,n);
for i:=1 to n do begin
readln(f1,x);
s[x]:=s[x]+1;
end;
for i:=1 to 1000 do
if s[i]<>0 then
writeln(f2,i,' ',s[i]);
close(f1);
close(f2);
End.