import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1].to!int;
    auto T = readln.chomp;
    auto S = T.to!(dchar[]);
    S.reverse;

    Tuple!(bool, int)[] A;
    bool tmp = false;

    foreach (i; 0..N) {
        if (S[i] != S[i+1]) {
            A ~= tuple(tmp, i);
            tmp ^= 1;
        }
    }
    A ~= tuple(false, N);

    int ans = 0;
    int pos = 0;
    int idx = 0;
    int mov = M;
    int[] hoge;

    while (pos < N) {
        if (idx == A.length.to!int - 1) {
            if (mov < M) {
                pos += mov;
                hoge.back += mov;
                mov = M;
            } else {
                pos += M;
                ans += 1;
                hoge ~= M;
            }
        } else if (pos + mov <= A[idx][1]) {
            if (mov < M) {
                pos += mov;
                hoge.back += mov;
                mov = M;
            } else {
                pos += M;
                ans += 1;
                hoge ~= M;
            }
        } else if (pos == A[idx][1]) {
            if (pos + mov > A[idx+1][1]) {
                if (mov == M) {
                    ans += 1;
                    hoge ~= A[idx+1][1] + 1 - pos;
                } else {
                    hoge.back += A[idx+1][1] + 1 - pos;
                }
                mov -= A[idx+1][1] + 1 - pos;
                pos = A[idx+1][1] + 1;
                idx += 2;
            } else if (mov == M) {
                writeln(-1);
                return;
            } else {
                mov = M;
            }
        } else {
            int d = min(A[idx][1] - pos, mov);
            if (mov == M) {
                hoge ~= d;
                ans += 1;
            } else {
                hoge.back += d;
            }
            pos += d;
            mov -= d;
        }
    }

    hoge.back -= hoge.sum - N;
    hoge.reverse;
    hoge.map!(to!string).join(" ").writeln;
}