program main;
var n,I,AC,WA,TLE,RE : longint;
    a : array[1..100000] of string;
 
begin
    AC := 0;
    WA := 0;
    TLE := 0;
    RE := 0;
    readln(n);
    for i := 1 to n do 
        readln(a[i]);
    for i := 1 to n do 
        case a[i] of 
            'AC' : inc(AC);
            'WA' : inc(WA);
            'TLE' : inc(TLE);
            'RE' : inc(RE);
        end;
    writeln('AC x ',AC);
    writeln('WA x ',WA);
    writeln('TLE x ',TLE);
    writeln('RE x ',RE);
end.