#include <bits/stdc++.h>
using namespace std;
char s[1000010];
int ans[1000010];
int n, k, p[1000010], f[1000010];
int main() {
  scanf("%d%d", &n, &k);
  scanf("%s", s);
  int j = -1;
  p[0] = -1;
  for (int i = 1; i <= n; i++) {
    j = p[i - 1];
    while (j >= 0 && s[j] != s[i - 1]) j = p[j];
    j++;
    p[i] = j;
    if (0 == i % (i - p[i])) {
      int t = i / (i - p[i]);
      if (t % k <= t / k)
        ans[i] = 1;
      else
        ans[i] = 0;
    } else {
      int t = i / (i - p[i]);
      if (t % k < t / k)
        ans[i] = 1;
      else
        ans[i] = 0;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d", ans[i]);
  return 0;
}
