<?php
// Your code here!
$arr = array(0, 0, 0, 0);

$n = fgets(STDIN);
for ($i = 0; $i <= $n; $i++){
    $s = trim(fgets(STDIN));
    switch ($s){
        case 'AC':
            $arr[0] = $arr[0] + 1;
            break;
        case 'WA':
            $arr[1] = $arr[1] + 1;
            break;
        case 'TLE':
            $arr[2] = $arr[2] + 1;
            break;
        case 'RE':
            $arr[3] = $arr[3] + 1;
            break;
        default:
            break;
    }
}

print "AC x $arr[0]\n";
print "WC x $arr[1]\n";
print "TLE x $arr[2]\n";
print "RE x $arr[3]\n";




?>
