n=int(input())
a  = []
for i in range(n):
    s=str(input())
    a.append(s)
print(("AC * ")+str(a.count("AC")))
print(("WA * ")+str(a.count("WA")))
print(("TLE * ")+str(a.count("TLE")))
print(("RA * ")+str(a.count("RA")))
