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

A = S.count("AC")
B = S.count("WA")
C = S.count("TLE")
D = S.count("RE")

print("AC × "+A)
print("WA × "+B)
print("TLE × "+C)
print("RE × "+D)