C0=0
C1=0
C2=0
C3=0
N=int(input())
S=list(range(N))
for i in range(N):
  S[i] = input()
for i in range(N):
  if S[i]==AC:
    C0 += 1
  elif S[i]==WA:
    C1 += 1
  elif S[i]==TLE:
    C2 += 1
  else:
    C3 += 1
print("AC","x",C0)
print("WA","x",C1)
print("TLE","x",C2)
print("RE","x",C3)