N = int(input())
S = []
for i in range(N):
    s = str(input())
    S.append(s)

result = ['AC', 'WA', 'TLE', 'RE']
C = [S.count(r) for r in result]

for (re, c) in zip(result, C):
    print(re + 'x' + str(c))