<?php
$n = (int) fgets(STDIN);
$S = [];
for ($i = 0; $i < $n; $i++) {
    $s = fgets(STDIN);
}
$ac = substr_count($s, 'AC');
$wa =  substr_count($s, 'WA');
$tle = substr_count($s, 'TLE');
$re = substr_count($s, 'RE');

echo 'AC x ' . $ac . PHP_EOL;
echo 'WA x ' . $ac . PHP_EOL;
echo 'TLE x ' . $ac . PHP_EOL;
echo 'RE x ' . $ac . PHP_EOL;