N = int(input())
A = 0
W = 0
T = 0
R = 0
for i in range(0,N):
  S[i] = int(input())
for i in range(0,N):
  if S[i] == 'AC':
    A+=1
  else if S[i] == 'WA':
    W+=1
  else if S[i] == 'TLE':
    T+=1
  else:
    R+=1
print("AC x {}",format(A))
print("WA x {}",format(W))
print("TLE x {}",format(T))
print("RE x {}",format(R))

 
    

