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"+a)
print("WA"+"x"+b)
print("TLE"+"x"+c)
print("RE"+"x"+d)