function rl()
   local r = {}
   for word in io.read():gmatch("%S+") do
      table.insert(r, tonumber(word))
   end
   return r
end

function ru()
   return unpack(rl())
end

function pu(x, ...)
   if x then
      io.write(x, ' ')
      return pu(...)
   else
      io.write('\n')
   end
end

N = ru()
counts = {AC = 0, WA = 0, TLE = 0, RE = 0}
for i = 1, N do
   Si = io.read()
   counts[Si] = counts[Si] + 1
end
for _, verdict in ipairs({'AC', 'WA', 'TLE', 'RE'}) do
   print(string.format("%s x %d", verdict, counts[verdict]))
end
