#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)

bool dp[2][400100];

constexpr int B = 22;
bool v[1 << B];

int main() {
    int n, k;
    cin >> n >> k;

    rep(i, 1 << B) {
        int now = i;
        rep(j, B - 1) {
            int nxt = 0;
            rep(k, B - j - 1) { nxt |= (1 - ((now >> k & 1) & (now >> k + 1 & 1))) << k; }
            now = nxt;
        }
        v[i] = now;
    }

    string s;
    cin >> s;
    rep(i, n) dp[0][i] = (s[i] - '0');
    int x = 0;
    while(n > k) {
        if(n - (B - 1) >= k) {
            int nn = n - (B - 1);
            unsigned s = 0;
            rep(i, B) s = (s << 1) + dp[x][i];
            rep(i, nn) {
                dp[x ^ 1][i] = v[s & ((1 << B) - 1)];
                s = (s << 1) + dp[x][i + B];
            }
            x ^= 1;
            n = nn;
        } else {
            rep(i, n - 1) { dp[x ^ 1][i] = (1 - (dp[x][i] & dp[x][i + 1])); }
            x ^= 1;
            n--;
        }
    }
    rep(i, k) cout << dp[x][i];
    cout << endl;
}