import collections
a=int(input())
b=[input() for i in range(a)]

c=collections.Counter(b)
n,m=zip(*c.most_common())
n=list(n)
m=list(m)
result=[0]*4
for i in range(len(n)):
    if n[i]=='AC':
        result[0]=m[i]
    if n[i]=='WA':
        result[1]=m[i]
    if n[i]=='TLE':
        result[2]=m[i]
    if n[i]=='RE':
        result[3]=m[i]
print('AC x',result[0])
print('WA ×',result[1])
print('TLE ×',result[2])
print('RE ×',result[3])
