n=int(input())
s=[input(i) for i in range(n)]

c=[0,0,0,0]

for i in range(n):
  if s[i]=="AC":
    c[0]+=1
  elif s[i]=="WA":
    c[1]+=1
  elif s[i]=="TLE":
    c[2]+=1
  else:
    c[3]+=1

print("AC","x",c[0])
print("WA","x",c[1])
print("TLE","x",c[2])
print("RE","x",c[3])