import scala.annotation.tailrec
object Main extends App {
  import scala.io.StdIn._

  val n = readInt
  val x = readLine.trim
  val d = readInt
  println(calMaxHamming(x, d))
  def calMaxHamming(x: String, d: Int): String = {
    @tailrec
    def sub(distance: Int, digits: List[Int], result: List[Char]): List[Char]= {
      digits match {
        case 1::xs if distance <= xs.length ⇒ sub(distance, xs, '1'::result)
        case 0::xs if distance > 0 ⇒ sub(distance - 1, xs, '1'::result)
        case 0::xs ⇒ sub(distance, xs, '0'::result)
        case 1::xs ⇒ sub(distance - 1, xs, '0'::result)
        case Nil ⇒ result
        case _ ⇒ ???
      }
    }
    sub(d, x.map(_.asDigit).toList, Nil).reverse.mkString
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }
}
