n = int(input())
S = []
a = 0
t = 0
w = 0
r = 0
for _ in range(n):
    S.append(input())
for i in range(n):
  if S[i]=="AC":
    a += 1
  elif S[i]=="TLE":
    t += 1
  elif S[i]=="WA":
    w += 1
  else:
    r += 1
a = str(a)
w = str(w)
t = str(t)
r = str(r)
print("ACx"+a)
print("WAx"+w)
print("TLEx"+t)
print("REx"+r)
    
    