#include <bits/stdc++.h>
using namespace std;

// #define int long long
#define ll long long
#define pb push_back
#define vi vector<int>
#define vii vector<vector<int> >

template <class X>
void print(X Target)
{
  cout << Target;// << '\n';
}

signed main()
{
  // ios::sync_with_stdio(false);
  int N, X, D;
  cin >> N;
  int bs[1001];
  bool check[1001] = {false};

  for (int i = 0; i < N; i++){
    scanf("%1d", &bs[i]);
  }
  cin >> D;

  int cnt = 0;
  for (int i = 0; i < N; i++){
    if (cnt == D) break;
    if (!check[i] && !bs[i]){
      bs[i] = 1;
      check[i] = true;
      cnt++;
    }
  }

  for (int i = N - 1; cnt < D && i >= 0; i--){
    if (!check[i] && bs[i]){
      bs[i] = 0;
      check[i] = true;
      cnt++;
    }
  }

  for (int i = 0; i < N; i++) print(bs[i]);
  cout << '\n';

  return (0);
}