use std::cmp::Ordering;

pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> Option<usize>;
    fn upper_bound(&self, x: &T) -> Option<usize>;
}

impl<T: Ord> BinarySearch<T> for [T] {
    //greater than or equal
    fn lower_bound(&self, x: &T) -> Option<usize> {
        let mut left = 0;
        let mut right = self.len();
        let mut result = None;
        while left < right {
            let med = (left + right) / 2;
            match self[med].cmp(x) {
                Ordering::Less => {
                    left = med + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    result = Some(med);
                    right = med;
                }
            }
        }
        result
    }
    fn upper_bound(&self, x: &T) -> Option<usize> {
        let mut left = 0;
        let mut right = self.len();
        let mut result = None;
        while left < right {
            let med = (left + right) / 2;
            match self[med].cmp(x) {
                Ordering::Equal | Ordering::Less => {
                    left = med + 1;
                }
                Ordering::Greater => {
                    result = Some(med);
                    right = med;
                }
            }
        }
        result
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use rand::{thread_rng, Rng};
    #[test]
    fn test_binary_search() {
        let vec = vec![-100, 0, 1, 2, 10, 100, 1000];
        assert_eq!(vec.lower_bound(&1), Some(2));
        assert_eq!(vec.lower_bound(&100), Some(5));
        assert_eq!(vec.lower_bound(&-5000), Some(0));
        assert_eq!(vec.lower_bound(&999), Some(6));
        assert_eq!(vec.lower_bound(&1001), None);

        assert_eq!(vec.upper_bound(&-101), Some(0));
        assert_eq!(vec.upper_bound(&0), Some(2));
        assert_eq!(vec.upper_bound(&100), Some(6));
        assert_eq!(vec.upper_bound(&1000), None);
    }

    #[test]
    fn test_random_binary_search() {
        let test_case = 50;
        let max_value = 200;
        let query_num = 100;
        let mut rng = thread_rng();
        for _ in 0..test_case {
            let mut seq: Vec<i32> = (0..500).map(|_| rng.gen_range(0, max_value)).collect();
            seq.sort();

            for _ in 0..query_num {
                let query = rng.gen_range(0, max_value + 100);
                let result = (seq.lower_bound(&query), seq.upper_bound(&query));
                //sequential search
                let naive_search = |x: i32| {
                    let mut lower_result = None;
                    let mut upper_result = None;
                    for i in 0..seq.len() {
                        if lower_result.is_none() && x <= seq[i] {
                            lower_result = Some(i);
                        }
                        if upper_result.is_none() && x < seq[i] {
                            upper_result = Some(i);
                        }
                    }
                    (lower_result, upper_result)
                };

                assert_eq!(result, naive_search(query));
            }
        }
    }
}

#[derive(Default)]
//NOTE
//declare variables to reduce the number of parameters for dp and dfs etc.
struct Solver {}

impl Solver {
    fn solve(&mut self) {
        let stdin = std::io::stdin();
        let mut scn = Scanner {
            stdin: stdin.lock(),
        };
        let n: usize = scn.read();
        let m: usize = scn.read();
        let s = scn.chars();
        let zeros: Vec<usize> = s
            .iter()
            .rev()
            .enumerate()
            .filter_map(|(idx, c)| if *c == '0' { Some(idx) } else { None })
            .collect();
        let mut paths = vec![];
        let mut pos = 0;
        while pos < n {
            let (left, right) = (pos + 1, pos + m);
            if right >= n {
                paths.push(n - pos);
                break;
            }
            let lower = zeros.lower_bound(&right);
            if lower.is_none() {
                println!("{}", -1);
                return;
            }
            let target = zeros[lower.unwrap()];
            if target == right {
                paths.push(m);
                pos = right;
            } else {
                //lower - 1
                let idx = lower.unwrap();
                if idx >= 1 {
                    if zeros[idx - 1] == pos {
                        println!("{}", -1);
                        return;
                    }
                    paths.push(zeros[idx - 1] - pos);
                    pos = zeros[idx - 1];
                } else {
                    println!("{}", -1);
                    return;
                }
            }
        }
        paths.reverse();
        for x in paths.iter() {
            print!("{} ", x);
        }
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024) // 64MB
        .spawn(|| {
            let mut solver = Solver::default();
            solver.solve()
        })
        .unwrap()
        .join()
        .unwrap();
}
pub mod utils {
    const DYX: [(isize, isize); 8] = [
        (0, 1),   //right
        (1, 0),   //down
        (0, -1),  //left
        (-1, 0),  //top
        (1, 1),   //down right
        (-1, 1),  //top right
        (1, -1),  //down left
        (-1, -1), //top left
    ];

    pub fn try_adj(y: usize, x: usize, dir: usize, h: usize, w: usize) -> Option<(usize, usize)> {
        let ny = y as isize + DYX[dir].0;
        let nx = x as isize + DYX[dir].1;
        if ny >= 0 && nx >= 0 {
            let ny = ny as usize;
            let nx = nx as usize;
            if ny < h && nx < w {
                Some((ny, nx))
            } else {
                None
            }
        } else {
            None
        }
    }
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 10748