N = int(input())
S = []
count_AC = 0
count_WA = 0
count_TLE = 0
count_RE = 0
for _ in range(N):
  S.append(input())
for i in S:
  if i == "AC":
    count_AC += 1  
  elif i == "WA":
    count_WA += 1    
  elif i == "TLE":
    count_TLE += 1
  elif i == "RE":
    count_RE += 1
  else:
    pass
a = "AC" + "x" + str(count_AC)
b = "WA" + "x" + str(count_WA)
c = "TLE" + "x" + str(count_TLE)
d = "RE" + "x" + str(count_RE)
print(a, b, c, d, sep="\n") 