n=int(input())
a=0
w=0
t=0
r=0
for i in range(n):
    code=input()
    if code=='AC':
        a += 1
    elif code=='WA':
        w += 1
    elif code=='TLE':
        t += 1
    else:
        r += 1
print('AC x 'a)
print('WA x 'w)
print('TLE x 't)
print('RE x 'r)