N = int(input())
S = [None for _ in range(N)]

for i in range(N):
   S[i] = input()

a = S.count('AC')
b = S.count('WA')
c = S.count('TLE')
d = S.count('RE')

print('AC　x　%d' %a)
print('WA　x　%d' %b)
print('TLE　x　%d' %c)
print('RE　x　%d' %d)