program hi;
type
    ref = (AC, WA, TLE, RE);

var 
    n, i: longint;
    s: ref;
    a: array[ref] of longint;

begin
    readln(n);
    for i := 1 to n do begin
        readln(s);
        inc(a[s]);
    end;
    for s := AC to RE do 
        writeln(s, ' x ', a[s])
end.