#include <bits/stdc++.h>
using namespace std;

// macros
#define overload_rep(va_0, va_1, va_2, name, ...) name
#define rep_0(i, n) for(int i = 0; i < (n); ++i)
#define rep_1(i, x, y) for(int i = (x); i <= (y); ++i)
#define rep(...) overload_rep(__VA_ARGS__, rep_1, rep_0)(__VA_ARGS__)
#define all(a) a.begin(), a.end()
#ifndef STOP_DEBUG
#define debug(...)\
    do { cerr << boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_cerr(__VA_ARGS__); cerr << noboolalpha; } while (0)
#else
#define debug(...)
#endif

// functions
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
void debug_cerr(){ cerr << '\n'; }
template<class Head, class... Tail>
void debug_cerr(Head head, Tail... tail){
    cerr << ' ' << head;
    debug_cerr(tail...);
}

// cin/cout setup
struct IoSetup{
    IoSetup(){
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} iosetup;

// libraries
template<class Monoid, class Effector>
struct LazySegmentTree {
private:

    int sz, height;
    vector<Monoid> node;
    vector<Effector> lazy;
    using Func_M = function<Monoid(Monoid, Monoid)>;
    using Func_E = function<Effector(Effector, Effector)>;
    using Merge = function<Monoid(Monoid, Effector, int)>;
    const Func_M operate_m;
    const Func_E operate_e;
    const Merge merge;
    const Monoid unit_m;
    const Effector unit_e;

    inline Monoid reflect(int i, int l){
        return lazy[i] == unit_e ? node[i] : merge(node[i], lazy[i], l);
    }

    inline void propagate(int i, int l){
        if(lazy[i] == unit_e)return;
        if(i < sz){
            lazy[i << 1] = operate_e(lazy[i << 1], lazy[i]);
            lazy[i << 1 | 1] = operate_e(lazy[i << 1 | 1], lazy[i]);
        }
        node[i] = merge(node[i], lazy[i], l);
        lazy[i] = unit_e;
    }

public:

    LazySegmentTree(){}
    LazySegmentTree(const Monoid m, const Effector e, const Func_M f1, const Func_E f2, const Merge f3) 
        : unit_m(m), unit_e(e), operate_m(f1), operate_e(f2), merge(f3) {}
    LazySegmentTree(const vector<Monoid>& vec, const Monoid m, const Effector e, const Func_M f1, const Func_E f2, const Merge f3) 
        : unit_m(m), unit_e(e), operate_m(f1), operate_e(f2), merge(f3) { bulid(vec); }
    ~LazySegmentTree(){}

    inline void init(){
        fill(node.begin(), node.end(), unit_m);
        fill(lazy.begin(), lazy.end(), unit_e);
    }

    inline void bulid(const vector<Monoid>& vec){
        for(sz = 1, height = 0; sz < (int)vec.size(); sz <<= 1, ++height);
        node.assign(sz << 1, unit_m);
        lazy.assign(sz << 1, unit_e);
        for(int i = 0; i < (int)vec.size(); ++i)
            node[i + sz] = vec[i];
        for(int i = sz - 1; i > 0; --i)
            node[i] = operate_m(node[i << 1], node[i << 1 | 1]);
    }

    inline void effect(int l, int r, Effector v){
        l += sz, r += sz - 1;
        for(int i = height; i >= 0; --i){
            propagate(l >> i, 1 << i);
            propagate(r >> i, 1 << i);
        }
        for(int tl = l, tr = r + 1, i = 1; tl < tr; tl >>= 1, tr >>= 1, i <<= 1){
            if(tl & 1)propagate(tl, i), lazy[tl] = operate_e(lazy[tl], v), propagate(tl++, i);
            if(tr & 1)propagate(--tr, i), lazy[tr] = operate_e(lazy[tr], v), propagate(tr, i);
        }
        for(int tl = l >> 1, tr = r >> 1, i = 0; tl > 0; tl >>= 1, tr >>= 1, ++i){
            node[tl] = operate_m(reflect(tl << 1, 1 << i), reflect(tl << 1 | 1, 1 << i));
            node[tr] = operate_m(reflect(tr << 1, 1 << i), reflect(tr << 1 | 1, 1 << i));
        }
    }

    inline Monoid fold(int l, int r){
        Monoid vl = unit_m, vr = unit_m;
        l += sz, r += sz - 1;
        for(int i = height; i >= 0; --i){
            propagate(l >> i, 1 << i);
            propagate(r >> i, 1 << i);
        }
        for(int tl = l, tr = r + 1, i = 1; tl < tr; tl >>= 1, tr >>= 1, i <<= 1){
            if(tl & 1)vl = operate_m(vl, reflect(tl++, i));
            if(tr & 1)vr = operate_m(reflect(--tr, i), vr);
        }
        return operate_m(vl, vr);
    }

    inline Monoid operator [] (int i){
        return fold(i, i + 1);
    }

};

// declarations

// solve
int main(){

    int N, M;
    cin >> N >> M;
    vector<bool> can(N + 1);
    rep(i, N + 1){
        char c;
        cin >> c;
        can[i] = (c == '0');
    }

    vector<int> mins(N + 1, N + 2);
    auto f1 = [](int x, int y){ return min(x, y); };
    auto f2 = [](int x, int y, int l){ return min(x, y); };
    LazySegmentTree<int, int> seg(mins, N + 2, N + 2, f1, f1, f2);
    seg.effect(0, 1, 0);
    rep(i, N + 1){
        if(seg[i] == N + 2){
            cout << "-1\n";
            return 0;
        }
        if(can[i]){
            int l = i + 1, r = i + M + 1;
            chmin(l, N);
            chmin(r, N + 1);
            if(l >= r)continue;
            seg.effect(l, r, i);
        }
    }

    vector<int> ans;
    int pos = N;
    while(pos > 0){
        int t = seg[pos];
        ans.push_back(pos - t);
        pos = t;
    }

    reverse(all(ans));
    for(int x : ans)cout << x << ' ';
    cout << '\n';
    return 0;

}


Measured memory_bytes: 3448