N = int(input())

S = [input() for i in range(N)]

#print(N)
#print(S)

count = [0, 0, 0, 0]

for s in S:
  if s in "AC":
    count[0] += 1
  elif s in "WA" :
    count[1] += 1
  elif s in "TLE" :
    count[2] += 1
  elif s in "RE":
    count[3] += 1
    
print("AC x " + str(count[0]))
print("WA x " + str(count[1]))
print("TL x " + str(count[2]))
print("RE x " + str(count[3]))