# -*- coding: utf-8 -*-
a = int(input())

AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(a):
    s = input()
    if s == "AC":
        AC = AC + 1
        continue
    if s == "AC":
        AC = AC + 1
        continue
    if s == "TLE":
        AC = AC + 1
        continue
    if s == "RE":
        AC = AC + 1
        continue


print("AC x {}".format(AC))
print("WA x {}".format(AC))
print("TLE x {}".format(AC))
print("RE x {}".format(AC))