program main;
var ac, wa, tle, re, i, n : longint;
 
begin
  readln(n);
  ac := 0; wa := 0; tle := 0; re := 0;
  for i := 1 to n do begin
    readln(s);
    if s = 'AC' then inc(ac)
    else if s = 'WA' then inc(wa)
    else if s = 'TLE' then inc(tle)
    else if s = 'RE' then inc(re)
  end;
  writeln('AC x ', ac);
  writeln('WA x ', wc);
  writeln('TLE x ', tle);
  writeln('RE x ', re);
end;