N=int(input())
S=list(map(str, input().split()))
x=S.count("AC")
y=S.count("WA")
z=S.count("TLE")
w=S.count("RE")
print("AC x []".format(x))
print("WA x []".format(y))
print("TLE x []".format(z))
print("RE x []".format(w))