n = io.read("*n", "*l")
t = {}
t.AC = 0
t.WA = 0
t.TLE = 0
t.RE = 0
for i = 1, n do
  s = io.read()
  t[s] = t[s] + 1
end
print("AC x " .. t.AC)
print("WA x " .. t.WA)
print("TLE x " .. t.TLE)
print("RE x " .. t.RE)
