#include <bits/stdc++.h>
using namespace std;
char ch, s[1000005];
int n, k, T, pre[1000005];
void read(int &x) {
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    ;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
}
void init() {
  for (int i = 2, j = 0; i <= n; i++) {
    while (j && s[i] != s[j + 1]) j = pre[j];
    if (s[i] == s[j + 1]) j++;
    pre[i] = j;
  }
}
int main() {
  read(n), read(k);
  scanf("%s", s + 1);
  init();
  for (int i = 1; i <= n; i++) {
    int b = i / (i - pre[i]);
    if (!(i % (i - pre[i]))) {
      if (b / k >= b % k)
        putchar('1');
      else
        putchar('0');
    } else {
      if (b / k > b % k)
        putchar('1');
      else
        putchar('0');
    }
  }
  putchar('\n');
  return 0;
}
