N=int(input())
S = []
for _ in range(N):
    S.append(input())
print('AC x '+ str(S.count('AC')))
print('WA x '+ str(S.count('AC')))
print('TLE x '+ str(S.count('TLE')))
print('RE x '+ str(S.count('RE')))