# frozen_string_literal: true

s = gets.chomp
rle = s.each_char.slice_when { |i, j| i != j }.map(&:size)

rle.each_slice(2) do |r, l|
  print '0 ' * (r - 1)
  print "#{(r / 2.0).ceil + l / 2} #{r / 2 + (l / 2.0).ceil} "
  print '0 ' * (l - 1)
end

puts ''