#!/usr/bin/env python3
import sys
rl = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

N = int(rl())
SL = read().split()

A, W, T, R = ord('A'), ord('W'), ord('T'), ord('R')
na, nw, nt, nr = 0, 0, 0, 0
for s in SL:
  print(s[0])
  if s[0] == A:
    na += 1
  elif s[0] == W:
    nw += 1
  elif s[0] == T:
    nt += 1
  elif s[0] == R:
    nr += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}'.format(na, nw, nt, nr))