N = int(input())
S = input()
 
ansAC = 0
ansWA = 0
ansTLE = 0
ansRE = 0
 
for i in range(N):
  if i == "AC":
    ansAC += 1
  elif i == "TLE":
    ansTLE += 1
  elif i == "WA":
    ansWA += 1
  elif i == "RE":
    ansRE += 1
print("AC x " + ansAC)
print("WA x " + ansWA)
print("TLE x " + ansTLE)
print("RE x " + ansRE)