N=int(input())
list=[]
for i in range(N):
  S=input()
  if S:
    list.append(S)
C0=list.count("AC")
C1=list.count("WA")
C2=list.count("TLE")
C3=list.count("RE")
print ("AC X ",C0)
print ("WA X ",C1)
print ("TLE X ",C2)
print ("RE X ",C3) 