AC, WA, TLE, RE = 0, 0, 0, 0
N = int(input())
for i in range(N):
  S[i] = input()
  if S[i] == 'AC':
    AC += 1
  elif S[i] == 'WA':
    WA += 1
  elif S[i] == 'TLE':
    TLE += 1
  elif S[i] == 'RE':
    RE += 1
print('AC x ',AC)
print('WA x ',WA)
print('TLE x ',TLE)
print('RE x ',RE)