import collections
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)

r = list(c.items())

if 'RE' not in c.keys():
  r.append(('RE',0))
elif 'TLE' not in c.keys():
  r.append(('TLE',0))
elif 'WA' not in c.keys():
  r.append(('WA',0))
elif 'AC' not in c.keys():
  r.append(('AC',0))

for i in r:
  print(str(i[0]) + ' x ' + str(i[1]))