#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <vector>
#include<string>
using namespace std;

int main() {

#ifdef INPUT_FROM_FILE
	ifstream cin("sample.in");
	ofstream cout("sample.out");
#endif
	int N,D;
	cin >> N;
	vector<int> X(N);
	vector<bool> used(N, false);
	string s;
	cin >> s;
	for (int i = 0; i < N; i++){
		X[i] = (s[i] == '1');
	}
	cin >> D;
	for (int i = 0; i < N; i++){
		if (used[i] == false && X[i] == 0 && D>0){
			used[i] = true;
			D--;
			X[i] = 1;
		}
	}
	for (int i = N-1; i >=0; i--){
		if (used[i] == false && X[i] == 1 && D>0){
			used[i] = true;
			D--;
			X[i] = 0;
		}
	}
	for (auto& i : X)cout << i; cout << endl;
	

	
	
	return 0;
}