N = int(input())
jud = [0,0,0,0]
for i in range(N):
  s = str(input())
  if(s == "AC"):
    jud[0]+=1
  elif(s == "WA"):
    jud[1] += 1
  elif(s == "TLE"):
    jud[2]+=1
  else:
    jud[3]+=1
print("AC x" +str(jud[0]))
print("WA x" +str(jud[1]))
print("TLE x" +str(jud[2]))
print("RE x" + str(jud[3]))
  