n=int(input())
res=[]
for i in range(n):
    res.append(input())

from collections import defaultdict
cnt=defaultdict(int)
cnt["AC"]=0
cnt["TLE"]=0
cnt["WA"]=0
cnt["RE"]=0
for i in res:
    cnt[i]+=1
for i in cnt.items():
    print(i[0],"x",i[1])