unittest
{
	assert( [ "9 3", "0001000100" ].solve == "1 3 2 3" );
	assert( [ "5 4", "011110" ].solve == "-1" );
	assert( [ "6 6", "0101010" ].solve == "6" );
}



import std.conv;
import std.format;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = 0L;
	auto m = 0L;
	input.front.formattedRead!"%s %s"( n, m );
	input.popFront;
	auto s = input.front.to!( dchar[] );
	
	long[] anss;
	auto i = n;
	LOOP: while( 0 < i )
	{
		foreach_reverse( j; 1L .. m + 1 )
		{
			if( 0 <= i - j && s[ i - j ] == '0' )
			{
				anss ~= j;
				i -= j;
				continue LOOP;
			}
		}
		return "-1";
	}
	return anss.to!( string[] ).retro.join( " " );
}
