N = int(input())
array = []
for _ in range(N):
  array.append(int(input()))
AC = 0
WA = 0
TLE = 0
RE = 0
for test in array:
  if 'AC' == test:
    AC += 1
  elif 'WA' == test:
    WA += 1
  elif 'TLE' == test:
    TLE += 1
  elif 'RE' == test:
    RE += 1
print(f'AC x {AC}')
print(f'WA x {WA}')
print(f'TLE x {TLE}')
print(f'RE x {RE}')