N = int(input())

result = {}
for _ in range(N):
  s = input()
  result[s] = result.get(s, 0) + 1

print(f"AC x {result['AC']}")
print(f"WA x {result['WA']}")
print(f"TLE x {result['TLE']}")
print(f"RE x {result['RE']}")