n = int(input())

d = {"AC":0,"WA":0,"TLE":0,"RE":0}
for i in range(n):
  c = input()
  d[c]=d[c]+1 
print("AC X "+str(d["AC"]))
print("WA X "+str(d["WA"]))
print("TLE X "+str(d["TLE"]))
print("RE X "+str(d["RE"]), end='')
