c=[]
for q in range(int(input())):
try:
v=input()
assert type(v)==int
c.append(v)
except:
c.append(6)
d=[]
for m in c:
d.append([m,c.count(m)+1])
6 is appended as the error if it's not an integer. It chooses how many elements the list has.