n = int(input())
s = [input() for i in range(n)]

status = ["AC","WA","TLE","RE"]
ans  = [0]*4

for i in range(len(status)):
    ans[i] = len([j for j in s if status[i] in s])
	s.remove(status[i])
    
print("AC x {}".format(ans[0]))
print("WA x {}".format(ans[1]))
print("TLE x {}".format(ans[2]))
print("RE x {}".format(ans[3]))

