n=int(input())
s=[]
for i in range(n):
    s.append(input())
a=[0]*4
for i in range(n):
    if s[i]=='AC':
        a[0]+=1
    elif s[i]=='WA':
        a[1]+=1
    elif s[i]=='TLE':
        a[2]+=1
    else:
        a[3]+=1
print("ACx{}".format(a[0]))
print("WAx{}".format(a[1]))
print("TLEx{}".format(a[2]))
print("REx{}".format(a[3]))






    