n = int(input())
l = []
for i in range(n):
  a = input()
  l.append(a)
print(f"{'AC'} x {l.count('AC')"}
print(f"{'WA'} x {l.count('WA')"}
print(f"{'TLE'} x {l.count('TLE')"}
print(f"{'RE'} x {l.count('RE')"}