use strict;
use warnings;

my $n = <STDIN>;
chomp($n);

my @lines;
my $cnt =0;
while ($cnt < $n){
my $line = <STDIN>;
  chomp($line);
  push(@lines, $line);
  $cnt++;
}

my $result = {
    "AC" =>0,
    "WA" =>0,
    "TLE" =>0,
    "RE" =>0
};

foreach my $text (@lines){
    my $len = length($text);
    if ($len > 1 && $len < 4){
        if ($text =~ /^AC$|^WA$|^RE$|^TLTE$/){
            $result->{$text}++;
        }
    }
}

print("AC x $result->{AC}\n");
print("WA x $result->{WA}\n");
print("RE x $result->{RE}\n");
print("TLE x $result->{TLE}\n");