rmap = {
  "AC": 0,
  "WA": 0,
  "TLE": 0,
  "RE": 0,
}

output_order = ["AC", "WA", "TLE", "RE"]

N - int(input())
for _ in range(N):
  rmap[input()] += 1

for k in output_order:
  print("{} x {}".format(k, rmap[k]))