N = int(input())
S = []
word_list = ["AC","WA","TLE","RE"]
for i in range(N):                     
    array = input()
    S.append(array)

for i in range(4):
  print(word_list[i] +"×"+str(S.count(word_list[i])))