N = int(input())

l = [0]*4
for i in range(N):
  S = input()
  if S == "AC":
    l[0] += 1
  elif S == "WA":
    l[1] += 1
  elif S == "TLE":
    l[2] += 1
  elif S == "re":
    l[3] += 1
    
print("AC x", l[0])
print("WA x", l[1])
print("TLE x", l[2])
print("RE x", l[3])