n = int(input())
s = [input() for i in range(n)]

ans = [0] * 4

for i in s:
  if i == "AC":
    ans[0] += 1
  elif i == "WA":
    ans[1] += 1
  elif i == "TLE":
    ans[2] += 1
  else:
    ans[3] == "RE"
    
print("AC x",ans[0])
print("WA x",ans[1])
print("TLE x",ans[2])
print("RE x",ans[3])