n = int(input())

d = {}

for _ in range(n):
    s = str(input())
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))