N = int(input())
AC = "AC"
WA = "WA"
TLE = "TLE"
RE = "RE"
list = []
for i in range(N):
    string = input()
    list.append(string)
C0 = list.count(AC)
C1 = list.count(WA)
C2 = list.count(TLE)
C3 = list.count(RE)
print(AC+f" x {C0}")
print(AC+f" x {C1}")
print(AC+f" x {C2}")
print(AC+f" x {C3}")
