object Main extends App {
  import scala.io.StdIn._
  import scala.math._
  val n = readInt()
  val series = 0L +: readLine.trim.split(' ').map(_.toLong) :+ 0L
  val diff = series.indices.tail.map{i ⇒ series(i) - series(i - 1)}.toArray
  var diffCount = (0 to n / 2).count(i ⇒ diff(i) != -diff(n - i))
  for (_ ← 0 until readInt()) {
    val Array(l, r, x) = readLine.trim.split(' ').map(_.toInt)
    if (l + r != n + 1) {
      if (diff(l - 1) == -diff(n - l + 1)) diffCount += 1
      diff(l - 1) += x
      if (diff(l - 1) == -diff(n - l + 1)) diffCount -= 1
      if (diff(r) == -diff(n - r)) diffCount += 1
      diff(r) -= x
      if (diff(r) == -diff(n - r)) diffCount -= 1
    }
    println(if (diffCount == 0) 1 else 0)
  }
}
