#include <bits/stdc++.h>
using namespace std;
const int N = 300 * 1000 + 10;
long long ps[2][N], a[N], seg[2][4 * N], lazy[2][4 * N];
void build(int s, int e, int v, int ind) {
  if (e - s <= 1) {
    seg[ind][v] = ps[ind][s];
    return;
  }
  int mid = (s + e) / 2;
  build(s, mid, 2 * v, ind);
  build(mid, e, 2 * v + 1, ind);
  seg[ind][v] = min(seg[ind][2 * v], seg[ind][2 * v + 1]);
}
void shift(int v, int ind) {
  lazy[ind][2 * v] += lazy[ind][v];
  lazy[ind][2 * v + 1] += lazy[ind][v];
  seg[ind][2 * v] += lazy[ind][v];
  seg[ind][2 * v + 1] += lazy[ind][v];
  lazy[ind][v] = 0;
}
void upd(int s, int e, int l, int r, int val, int v, int ind) {
  if (s >= r || e <= l) return;
  if (l <= s && e <= r) {
    seg[ind][v] += val;
    lazy[ind][v] += val;
    return;
  }
  shift(v, ind);
  int mid = (s + e) / 2;
  upd(s, mid, l, r, val, 2 * v, ind);
  upd(mid, e, l, r, val, 2 * v + 1, ind);
  seg[ind][v] = min(seg[ind][2 * v], seg[ind][2 * v + 1]);
}
long long get_min(int s, int e, int l, int r, int v, int ind) {
  if (s >= r || e <= l) return 1ll * 1000 * 1000 * 1000 * 100;
  if (l <= s && e <= r) return seg[ind][v];
  int mid = (s + e) / 2;
  shift(v, ind);
  return min(get_min(s, mid, l, r, 2 * v, ind),
             get_min(mid, e, l, r, 2 * v + 1, ind));
}
int main() {
  int n, m, x1 = 0, x2 = 1;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i += 2) {
    if (i > 1) ps[0][i / 2] += ps[0][i / 2 - 1];
    ps[0][i / 2] += a[i] - a[i - 1];
    x1++;
  }
  ps[1][0] = a[0];
  for (int i = 2; i < n; i += 2) {
    ps[1][i / 2] = a[i] - a[i - 1];
    if (i > 0) ps[1][i / 2] += ps[1][i / 2 - 1];
    x2++;
  }
  build(0, x1, 1, 0);
  build(0, x2, 1, 1);
  cin >> m;
  for (int i = 0; i < m; i++) {
    int t, a, b, k;
    cin >> t >> a >> b;
    if (t == 1) {
      cin >> k;
      if (a % 2 == 1) {
        upd(0, x1, a / 2, (b - 1) / 2 + 1, k, 1, 0);
        if (b % 2 == 1) {
          if (x1 > (b + 1) / 2) upd(0, x1, (b + 1) / 2, x1, k, 1, 0);
          if (x2 > (b + 1) / 2) upd(0, x2, (b + 1) / 2, x2, -k, 1, 1);
        }
      } else {
        upd(0, x2, a / 2, b / 2 + 1, k, 1, 1);
        if (b % 2 == 0) {
          if (x2 > b / 2 + 1) upd(0, x2, b / 2 + 1, x2, k, 1, 1);
          if (x1 > b / 2) upd(0, x1, b / 2, x1, -k, 1, 0);
        }
      }
    } else {
      if (a % 2 == 0) {
        long long mn1 = get_min(0, x2, a / 2, b / 2 + 1, 1, 1);
        long long mn2 = get_min(0, x1, (a + 1) / 2, (b + 1) / 2, 1, 0);
        long long mn3 = 0;
        if (a > 0) mn3 = get_min(0, x1, (a - 1) / 2, (a - 1) / 2 + 1, 1, 0);
        long long mn4 = get_min(0, x2, b / 2, b / 2 + 1, 1, 1);
        if (b % 2 == 1) mn4 = get_min(0, x1, b / 2, b / 2 + 1, 1, 0);
        if (b % 2 == 0)
          mn4 += mn3;
        else
          mn4 -= mn3 - 1;
        if (mn1 + mn3 > 0 && mn2 + 1 > mn3 && mn4 == 1)
          cout << 1 << '\n';
        else
          cout << 0 << '\n';
      } else {
        long long mn1 = get_min(0, x1, a / 2, b / 2 + 1, 1, 0);
        long long mn2 = get_min(0, x2, (a + 1) / 2, b / 2 + 1, 1, 1);
        long long mn3 = 0;
        if (a > 0) mn3 = get_min(0, x2, (a - 1) / 2, (a - 1) / 2 + 1, 1, 1);
        long long mn4 = get_min(0, x2, b / 2, b / 2 + 1, 1, 1);
        if (b % 2 == 1) mn4 = get_min(0, x1, b / 2, b / 2 + 1, 1, 0);
        if (b % 2 == 1)
          mn4 += mn3;
        else
          mn4 -= mn3 - 1;
        if (mn2 + 1 > mn3 && mn1 + mn3 > 0 && mn4 == 1)
          cout << 1 << '\n';
        else
          cout << 0 << '\n';
      }
    }
  }
}
