program gathering_children
  implicit none
  integer :: n, a(100000) = 1, i
  character(100000) :: s
  read(*,*) s
  n = len_trim(s)
  do i = 1, n-2
    if (s(i:i) == "R" .and. s(i+1:i+1) == "R") then
      a(i+2) = a(i+2)+a(i)
      a(i) = 0
    end if
  end do
  do i = n, 3, -1
    if (s(i:i) == "L" .and. s(i-1:i-1) == "L") then
      a(i-2) = a(i-2)+a(i)
      a(i) = 0
    end if
  end do
  write(*,'(i0)',advance='no') a(1)
  do i = 2, n
    write(*,'(x,i0)',advance='no') a(i)
  end do
  write(*,*)
  stop
end program gathering_children