program judge_status_summary
  implicit none
  integer :: n, i, k, c(4) = 0
  character(1) :: s
  read(*,*) n
  do i = 1, n
    read(*,*) s
    select case (s)
    case ('A')
      k = 1
    case ('W')
      k = 2
    case ('T')
      k = 3
    case ('R')
      k = 4
    end select
    c(k) = c(k) + 1
  end do
  write(*,'(a,x,a,x,i0)') 'AC', 'x', c(1)
  write(*,'(a,x,a,x,i0)') 'WA', 'x', c(2)
  write(*,'(a,x,a,x,i0)') 'TLE', 'x', c(3)
  write(*,'(a,x,a,x,i0)') 'RE', 'x', c(4)
end program judge_status_summary