n=int(input())
li=[input() for _ in range(n)]
ac=li.index("AC")
wa=li.index("WA")
tle=li.index("TLE")
re=li.index("RE")
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))