x=int(input(''))
y=[0]*x
for i in range(x):
  y[i]=input('')
a=0
w=0
t=0
r=0
for i in range(x):
  if y[i]==AC:
    a=a+1
  elif y[i]==WA:
    w=w+1
  elif y[i]==TLE:
    t=t+1
  else:
    r=r+1
print('AC x {0}\nWA x {1}\nTLE x {2}\nRE x {r}'.format(a,w,t,r))
  