import collections
n = int(input())
m = [input() for i in range(n)]

check = ["AC","WA","TLE","RE"]
for i in check:
  m.append(i)

c = collections.Counter(m)

for i,j in c.items():
  print(i+ " x " +str(j-1))