program answer
  implicit none

  integer :: N, i, a, b, c, d
  character :: S(10000)

  read(*,*) N
  do i = 1, n
     read(*,*) S(i:i)
  end do

  a=0
  b=0
  c=0
  d=0

  do i = 1, n
     if(S(i)=='A') then
        a=a+1
     else if(S(i)=="W") then
        b=b+1
     else if(S(i)=="T") then
        c=c+1
     else if(S(i)=="R") then
        d=d+1
     end if
  end do

  write(*,*) 'AC', ' x',a
  write(*,*) 'WA', ' x', b
  write(*,*) 'TLE', ' x', c
  write(*,*) 'RE', ' x', d

  stop
 end program answer
