from collectinos import defaultdict
d = defaultdict(int)
N = int(input())
for i in range(N):
  d[input()] += 1
print(f"AC x {d['AC']}")
print(f"WA x {d['WA']}")
print(f"TLE x {d['TLE']}")
print(f"RE x {d['RE']}")