read n;
AC=0;
TLE=0;
WA=0;
RE=0;

while read line ;
do
    if [ $line = "AC" ] ; then
        AC=$(($AC+1));
    elif [ $line = "TLE" ] ; then
        TLE=$(($TLE+1));
    elif [ $line = "WA" ] ; then
        WA=$(($WA+1));
    else
        RE=$(($RE+1));
    fi;
done;
echo AC x $AC;
echo TLE x $TLE;
echo WA x $WA;
echo RE x $RE;
