N = int(input())

ans = [0]*4
for n in range(n):
  C = input()
  if C = "AC":
    ans[0] += 1
  elif C = "WA":
    ans[1] += 1
  elif C = "TLE":
    ans[2] += 1
  elif C = "RE":
    ans[3] += 1

print("AC x ".format(ans[0]))
print("WA x ".format(ans[1]))
print("TLE x ".format(ans[2]))
print("RE x ".format(ans[3]))
