n = int(input())
import collections
co = collections.Counter()
for i in range(n):
    co[input()] +=1
print(f"AC x {co["AC"]}")
print(f"WA x {co["WA"]}")
print(f"TLE x {co["TLE"]}")
print(f"RE x {co["RE"]}")
