while (l = gets.chomp) && l != 'END OF INPUT'
  puts l.split('').each_with_index.select{ |e| e[0] == ' ' }
        .map{ |e| e[1] }.unshift(-1).push(l.size)
        .each_cons(2).map{ |i, j| j - i - 1 } * ''
end