#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 100;
const int INF = 1e9 + 17;
struct segment {
  int lazy[MAXN * 4];
  int seg[MAXN * 4];
  void upd(int ql, int qr, int qv, int xl = 0, int xr = MAXN, int id = 0) {
    if (ql <= xl && xr <= qr) {
      seg[id] += qv;
      lazy[id] += qv;
      return;
    }
    if (qr <= xl || xr <= ql) return;
    int mid = (xl + xr) / 2;
    upd(ql, qr, qv, xl, mid, 2 * id + 1);
    upd(ql, qr, qv, mid, xr, 2 * id + 2);
    seg[id] = min(seg[2 * id + 1], seg[2 * id + 2]) + lazy[id];
  }
  int get(int ql, int qr, int xl = 0, int xr = MAXN, int id = 0) {
    if (ql <= xl && xr <= qr) return seg[id];
    if (qr <= xl || xr <= ql) return INF;
    int mid = (xl + xr) / 2;
    return min(get(ql, qr, xl, mid, 2 * id + 1),
               get(ql, qr, mid, xr, 2 * id + 2)) +
           lazy[id];
  }
};
segment A, B;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int s = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    s = a - s;
    if (i % 2)
      B.upd(i, i + 1, s), A.upd(i, i + 1, INF);
    else
      A.upd(i, i + 1, s), B.upd(i, i + 1, INF);
  }
  int q;
  cin >> q;
  while (q--) {
    int qt;
    cin >> qt;
    if (qt == 2) {
      int x, y;
      cin >> x >> y;
      y++;
      int c = 0;
      if (x) c = min(A.get(x - 1, x), B.get(x - 1, x));
      int a = A.get(x, y);
      int b = B.get(x, y);
      if (x % 2)
        a -= c, b += c;
      else
        a += c, b -= c;
      int last = min(A.get(y - 1, y), B.get(y - 1, y));
      if ((x + y) % 2)
        last += c;
      else
        last -= c;
      if (x % 2) {
        b--;
        if ((x + y) % 2 == 1) last--;
        if (min(a, b) < 0) {
          cout << 0 << '\n';
          continue;
        }
        if (last != 0) {
          cout << 0 << '\n';
          continue;
        }
        cout << 1 << '\n';
      } else {
        a--;
        if ((x + y) % 2 == 1) last--;
        if (min(a, b) < 0) {
          cout << 0 << '\n';
          continue;
        }
        if (last != 0) {
          cout << 0 << '\n';
          continue;
        }
        cout << 1 << '\n';
      }
    } else {
      int x, y, k;
      cin >> x >> y >> k;
      y++;
      if (x % 2 == y % 2 && x % 2) B.upd(x, y, k);
      if (x % 2 != y % 2 && x % 2) B.upd(x, n, k), A.upd(y, n, -k);
      if (x % 2 != y % 2 && x % 2 == 0) A.upd(x, n, k), B.upd(y, n, -k);
      if (x % 2 == y % 2 && x % 2 == 0) A.upd(x, y, k);
    }
  }
}
