n = int(input())
a = 0
b = 0
c = 0
d = 0

for i in range(n):
  S = str(input())
  if S == 'AC':
    a += 1
  if S == 'WA':
    b += 1
  if S == 'TLE':
    c += 1
  if S == 'RE':
    d += 1
print('AC x '+str(a)
print('WA x '+str(b))
print('TLE x '+str(c))
print('RE x '+str(d))