#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
inline int getBit(long long x, int pos) { return ((x >> pos) & 1); }
const double EPS = 1e-9;
const double PI = acos(-1.0);
const int MAXN = (int)(1e6) + 10;
int n, k;
char str[MAXN];
int dp[MAXN];
int t[4 * MAXN];
int ans[MAXN];
void update(int v, int tl, int tr, int lf, int rg) {
  if (lf > rg) return;
  if (t[v] == 1) return;
  if (tl == lf && tr == rg) {
    t[v] = 1;
  } else {
    int tm = (tl + tr) / 2;
    update(v * 2 + 1, tl, tm, lf, min(tm, rg));
    update(v * 2 + 2, tm + 1, tr, max(lf, tm + 1), rg);
  }
}
void getAns(int v, int tl, int tr, int sm) {
  sm |= t[v];
  if (tl == tr) {
    ans[tl] = sm;
  } else {
    int tm = (tl + tr) / 2;
    getAns(v * 2 + 1, tl, tm, sm);
    getAns(v * 2 + 2, tm + 1, tr, sm);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  scanf("%s", str);
  for (int i = 1, l = 0, r = 0; i < n; i++) {
    if (i < r) {
      dp[i] = min(dp[i - l], r - i);
    }
    while (i + dp[i] < n && str[dp[i]] == str[i + dp[i]]) dp[i]++;
    if (i + dp[i] - 1 > r) {
      l = i;
      r = i + dp[i] - 1;
    }
  }
  dp[0] = n + 1;
  for (int len = 1; len <= n; len++) {
    int cnt = 0;
    int i = 0;
    while (i < n && dp[i] >= len && cnt < k) {
      i += len;
      cnt++;
    }
    if (cnt == k) {
      int lf = i - 1;
      int rg = min(i + dp[i] - 1, i + len - 1);
      rg = min(rg, n - 1);
      update(0, 0, n - 1, lf, rg);
    }
  }
  getAns(0, 0, n - 1, 0);
  for (int i = 0; i < n; i++) {
    printf("%d", ans[i]);
  }
  return 0;
}
