N = int(input())
S=list(map(str, input().split()))

c0 = 0
c1 = 0
c2 = 0
c3 = 0

for i in S:
  if i == "AC":
    c0 += 1
    
  if i == "WA":
    c0 += 1

  if i == "TLE":
    c0 += 1
    
  if i == "RE":
    c0 += 1
  
  
print("AC x " + str(c0))
print("WA x " + str(c1))
print("TLE x " + str(c2))
print("RE x " + str(c3))