import Foundation

class Scanner {
    static func readInt() -> Int {
        return Int(readLine()!)!
    }
    
    static func readIntArr() -> [Int] {
        return readLine()!.split(separator: " ").map { Int($0)! }
    }
    
    static func readM(_ n: Int) -> [[Int]] {
        var res = [[Int]]()
        for _ in 0..<n {
            res.append(readIntArr())
        }
        return res
    }
    
    static func readUknownIntMat() -> [[Int]] {
        var res = [[Int]]()
        while let line = readLine() {
            res.append(line.split(separator: " ").map { Int($0)! })
        }
        return res
    }
    
    static func readString() -> String {
        return readLine()!
    }
}

class Printer {
    static func printIntArray(_ arr: [Int]) {
        print(arr.map { String($0) }.joined(separator: " "))
    }
}

let nm = Scanner.readIntArr()
let str = Scanner.readString()
let arr: [Int] = Array(str).map{ Int(String($0))! }

let n = nm[0]
let m = nm[1]
/*
 9 3
 0001000100
 */
var dp = [Int](repeating: -1, count: nm[0]+1)
var path = [[Int]](repeating: [Int](), count: nm[0]+1)


//0 1   2   3   4   5   6   7   8   9
//0 0   0   1   0   0   0   1   0   0
func dfs(_ pos: Int) -> Int {
    guard pos >= 0 else {
        return Int.max
    }
    guard pos > 0 else {
        return arr[pos] == 0 ? 0 : Int.max
    }
    guard arr[pos] == 0 else {
        return Int.max
    }
    
    guard dp[pos] == -1 else {
        return dp[pos]
    }
    
    var res = Int.max
    
    for i in stride(from: m, through: 1, by: -1) {
        let rest = dfs(pos-i)
        guard rest != Int.max else {
            continue
        }
        if res > rest+1 {
            res = rest+1
            path[pos] = path[pos-i] + [i]
        }
    }
    dp[pos] = res
    return res
}

let res = dfs(n)
if res != Int.max {
    Printer.printIntArray(path[n])
} else {
    print(-1)
}