N=int(input())
S=[input() for i in range(N)]
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)
