import sys
N = int(input())
s = []
for l in sys.stdin:
    s.append(int(l))
    
a = s.count("AC")
b = s.count("WA")
c = s.count("TLE")
d = s.count("RE")
 
print("AC"+"x"+str(a))
print("WA"+"x"+str(b))
print("TLE"+"x"+str(c))
print("RE"+"x"+str(d))