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")
X="AC x []".format(x)
Y="WA x []".format(y)
Z="TLE x []".format(z)
W="RE x []".format(w)
print(X)
print(Y)
print(Z)
print(W)