ar = [0, 0, 0, 0]
for _ in range(int(input())):
  s = input()
  ar[{"AC": 0, "WA": 1, "TLE": 2, "RE": 3}[s]] += 1
print("AC x", arr[0])
print("WA x", arr[1])
print("TLE x", arr[2])
print("RE x", arr[3])