a = int(input())
str_list = [input() for _ in range(a)]
print("{} {}".format("AC × ", str_list.count('AC')))
print("{} {}".format("WA × ", str_list.count('WA')))
print("{} {}".format("TLE × ", str_list.count('TLE')))
print("{} {}".format("RE × ", str_list.count('RE')))