N = int(input())
s = [input() for i in range(N)]
row = ['AC', 'WA', 'TLE', 'RE']
for r in row:
    count = 0
    for col in s:
        if col == r:
            count += 1
    print(r, '×', count, sep=' ')
