import java.util.Scanner

case class Input(xs: List[Int], as: List[Int]) {
  def solved: Output = {
    val xary: Array[Int] = xs.toArray
    val n = xs.length
    for (a <- as) {
      if (!(xary(a-1) == 2019) && (a == n || !(xary(a-1)+1 == xary(a))))
        xary(a-1) += 1
    }
    Output(xary.toList)
  }
}

object Input {
  def fromStdin(): Input = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val xs = List.fill(n)(sc.nextInt)
    val m = sc.nextInt()
    val as = List.fill(m)(sc.nextInt)
    Input(xs, as)
  }
}

case class Output(ys: List[Int]) {
  override def toString(): String = {
    ys.foldLeft("")(_ + _.toString() + "\n")
  }
  def print() = printf(this.toString())
}

object Main extends App {
  Input.fromStdin().solved.print()
}

