N = int(input())
Ss = []
for i in range(N):
  Ss.append(input())
 
C0, C1, C2, C3 = 0, 0, 0, 0
for S in Ss:
  if S == 'AC':
    C0 += 1
  elif S == 'WA':
    C1 += 1
  elif S == 'TLE':
    C2 += 1
  else:
    C3 += 1
print("AC X {}".format(C0))
print("WA X {}".format(C1))
print("TLE X {}".format(C2))
print("RE X {}".format(C3))