#include <bits/stdc++.h>
using namespace std;
const int nmax = 2e5;
const int lgmax = 1e5;
const long long inf = (1LL << 62);
long long v[nmax + 1];
long long s[2][lgmax + 1];
struct Aint_nod {
  long long val, lazy;
};
class Aint {
 public:
  Aint_nod aint[4 * lgmax + 1];
  void build(int nod, int x, int y, int ind) {
    if (x == y) {
      aint[nod].val = s[ind][x];
      aint[nod].lazy = 0;
      return;
    }
    int mij = (x + y) / 2;
    build(2 * nod, x, mij, ind);
    build(2 * nod + 1, mij + 1, y, ind);
    aint[nod] = uneste(aint[2 * nod], aint[2 * nod + 1]);
  }
  void update(int nod, int x, int y, int st, int dr, long long val) {
    if (y < 1) return;
    if (st <= x && y <= dr) {
      aint[nod].lazy += val;
      return;
    }
    int mij = (x + y) / 2;
    propaga(nod);
    if (st <= mij) update(2 * nod, x, mij, st, dr, val);
    if (mij < dr) update(2 * nod + 1, mij + 1, y, st, dr, val);
    aint[nod] = uneste(aint[2 * nod], aint[2 * nod + 1]);
  }
  long long query(int nod, int x, int y, int st, int dr) {
    if (st <= x && y <= dr) {
      return val_adv(aint[nod]);
    }
    int mij = (x + y) / 2;
    long long sol = inf;
    propaga(nod);
    if (st <= mij) sol = min2(sol, query(2 * nod, x, mij, st, dr));
    if (mij < dr) sol = min2(sol, query(2 * nod + 1, mij + 1, y, st, dr));
    return sol;
  }

 private:
  inline long long min2(long long x, long long y) { return (x < y ? x : y); }
  inline long long val_adv(Aint_nod x) { return x.val + x.lazy; }
  inline void propaga(int nod) {
    aint[2 * nod].lazy += aint[nod].lazy;
    aint[2 * nod + 1].lazy += aint[nod].lazy;
    aint[nod].val += aint[nod].lazy;
    aint[nod].lazy = 0;
  }
  inline Aint_nod uneste(Aint_nod x, Aint_nod y) {
    Aint_nod sol;
    sol.val = min2(val_adv(x), val_adv(y));
    sol.lazy = 0;
    return sol;
  }
} aint[2];
int lg[2];
inline int val(int x) {
  if (x % 2 == 0)
    return x / 2;
  else
    return (x + 1) / 2;
}
int main() {
  int n;
  cin >> n;
  lg[0] = n / 2;
  lg[1] = n - lg[0];
  for (int i = 1; i <= n; ++i) {
    cin >> v[i];
  }
  s[0][0] = s[1][0] = 0;
  for (int i = 1; i <= n; ++i) {
    if (i % 2 == 0) {
      s[0][i / 2] = v[i] - s[1][i / 2];
    } else {
      s[1][(i + 1) / 2] = v[i] - s[0][i / 2];
    }
  }
  aint[0].build(1, 1, lg[0], 0);
  aint[1].build(1, 1, lg[1], 1);
  int q;
  cin >> q;
  while (q--) {
    int tip, x, y;
    long long k;
    cin >> tip >> x >> y;
    ++x, ++y;
    if (tip == 1) {
      cin >> k;
      int ind, lim;
      ind = x % 2;
      lim = y;
      if (y % 2 != ind) {
        --lim;
      }
      if (x <= lim) aint[ind].update(1, 1, lg[ind], val(x), val(lim), k);
      if (y % 2 == ind) {
        if (y % 2 == 0) {
          if (y + 2 <= n) aint[0].update(1, 1, lg[0], val(y + 2), lg[0], k);
          if (y + 1 <= n) aint[1].update(1, 1, lg[1], val(y + 1), lg[1], -k);
        } else {
          if (y + 1 <= n) aint[0].update(1, 1, lg[0], val(y + 1), lg[0], -k);
          if (y + 2 <= n) aint[1].update(1, 1, lg[1], val(y + 2), lg[1], k);
        }
      }
    } else {
      long long ultimul = aint[y % 2].query(1, 1, lg[y % 2], val(y), val(y));
      long long aux;
      if (x - 1 == 0)
        aux = 0;
      else
        aux = aint[(x - 1) % 2].query(1, 1, lg[(x - 1) % 2], val(x - 1),
                                      val(x - 1));
      if (y % 2 != (x - 1) % 2) {
        ultimul += aux;
      } else {
        ultimul -= aux;
      }
      if (ultimul != (y - x + 1) % 2) {
        cout << "0\n";
      } else {
        long long par, impar;
        int c10 = x, c20 = y, c11 = x, c21 = y;
        if (x % 2 == 1) ++c10;
        if (y % 2 == 1) --c20;
        if (c10 <= c20) {
          par = aint[0].query(1, 1, lg[0], val(c10), val(c20));
        }
        if (x % 2 == 0) ++c11;
        if (y % 2 == 0) --c21;
        if (c11 <= c21) {
          impar = aint[1].query(1, 1, lg[1], val(c11), val(c21));
        }
        if (x % 2 == 0) {
          swap(par, impar);
          swap(c10, c11);
          swap(c20, c21);
        }
        bool ok = 1;
        if (c10 <= c20) {
          par -= aux;
          if (par < 0) {
            ok = 0;
          }
        }
        if (c11 <= c21) {
          impar += aux;
          if (impar < 1) {
            ok = 0;
          }
        }
        cout << ok << "\n";
      }
    }
  }
  return 0;
}
