from collections import Counter

N = int(input())
list_s = []
for i in range(N):
  S = input() 
  list_s.append(S)

D = Counter(list_s)

print("AC ｘ " + str(D["AC"]))
print("WA ｘ " + str(D["WA"]))
print("TLE ｘ " + str(D["TLE"]))
print("RE ｘ " + str(D["RE"]))