#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, a[N], dp1[N], dp2[N], fin[N];
long long val[4 * N], pval[4 * N];
int dpl[4 * N], pdpl[4 * N];
int dpr[4 * N], pdpr[4 * N];
int ans[4 * N], pans[4 * N];
void build(int idx, int lo, int hi, int ty) {
  if (lo == hi) {
    if (ty == 0)
      val[idx] = a[lo];
    else if (ty == 1)
      dpl[idx] = lo - dp1[lo] + 1;
    else if (ty == 2)
      dpr[idx] = lo + dp2[lo] - 1;
    else
      ans[idx] = fin[lo];
    return;
  }
  int mid = (lo + hi) / 2;
  build(2 * idx, lo, mid, ty);
  build(2 * idx + 1, mid + 1, hi, ty);
  if (ty == 0)
    val[idx] = min(val[2 * idx], val[2 * idx + 1]);
  else if (ty == 1)
    dpl[idx] = min(dpl[2 * idx], dpl[2 * idx + 1]);
  else if (ty == 2)
    dpr[idx] = max(dpr[2 * idx], dpr[2 * idx + 1]);
  else
    ans[idx] = max(ans[2 * idx], ans[2 * idx + 1]);
}
void lazy_val(int idx) {
  val[idx] += pval[idx];
  pval[2 * idx] += pval[idx];
  pval[2 * idx + 1] += pval[idx];
  pval[idx] = 0;
}
void update_val(int idx, int lo, int hi, int st, int en, long long vl) {
  if (lo == st && hi == en) {
    if (lo == hi)
      val[idx] += vl;
    else
      pval[idx] += vl;
    return;
  }
  if (pval[idx]) lazy_val(idx);
  int mid = (lo + hi) / 2;
  if (en <= mid)
    update_val(2 * idx, lo, mid, st, en, vl);
  else if (st > mid)
    update_val(2 * idx + 1, mid + 1, hi, st, en, vl);
  else {
    update_val(2 * idx, lo, mid, st, mid, vl);
    update_val(2 * idx + 1, mid + 1, hi, mid + 1, en, vl);
  }
  val[idx] =
      min(val[2 * idx] + pval[2 * idx], val[2 * idx + 1] + pval[2 * idx + 1]);
}
long long query_val(int idx, int lo, int hi, int st, int en) {
  if (st == 0 || st == n + 1) return 0;
  if (lo == st && hi == en) return val[idx] + pval[idx];
  if (pval[idx]) lazy_val(idx);
  int mid = (lo + hi) / 2;
  if (en <= mid)
    return query_val(2 * idx, lo, mid, st, en);
  else if (st > mid)
    return query_val(2 * idx + 1, mid + 1, hi, st, en);
  else
    return min(query_val(2 * idx, lo, mid, st, mid),
               query_val(2 * idx + 1, mid + 1, hi, mid + 1, en));
}
void lazy_dpl(int idx) {
  dpl[idx] += pdpl[idx];
  pdpl[2 * idx] += pdpl[idx];
  pdpl[2 * idx + 1] += pdpl[idx];
  pdpl[idx] = 0;
}
void update_dpl(int idx, int lo, int hi, int st, int en, int vl) {
  if (lo == st && hi == en) {
    if (lo == hi)
      dpl[idx] += vl;
    else
      pdpl[idx] += vl;
    return;
  }
  if (pdpl[idx]) lazy_dpl(idx);
  int mid = (lo + hi) / 2;
  if (en <= mid)
    update_dpl(2 * idx, lo, mid, st, en, vl);
  else if (st > mid)
    update_dpl(2 * idx + 1, mid + 1, hi, st, en, vl);
  else {
    update_dpl(2 * idx, lo, mid, st, mid, vl);
    update_dpl(2 * idx + 1, mid + 1, hi, mid + 1, en, vl);
  }
  dpl[idx] =
      min(dpl[2 * idx] + pdpl[2 * idx], dpl[2 * idx + 1] + pdpl[2 * idx + 1]);
}
int query_dpl(int idx, int lo, int hi, int st, int en) {
  if (lo == st && hi == en) return dpl[idx] + pdpl[idx];
  if (pdpl[idx]) lazy_dpl(idx);
  int mid = (lo + hi) / 2;
  if (en <= mid)
    return query_dpl(2 * idx, lo, mid, st, en);
  else if (st > mid)
    return query_dpl(2 * idx + 1, mid + 1, hi, st, en);
  else
    return min(query_dpl(2 * idx, lo, mid, st, mid),
               query_dpl(2 * idx + 1, mid + 1, hi, mid + 1, en));
}
void lazy_dpr(int idx) {
  dpr[idx] += pdpr[idx];
  pdpr[2 * idx] += pdpr[idx];
  pdpr[2 * idx + 1] += pdpr[idx];
  pdpr[idx] = 0;
}
void update_dpr(int idx, int lo, int hi, int st, int en, int vl) {
  if (lo == st && hi == en) {
    if (lo == hi)
      dpr[idx] += vl;
    else
      pdpr[idx] += vl;
    return;
  }
  if (pdpr[idx]) lazy_dpr(idx);
  int mid = (lo + hi) / 2;
  if (en <= mid)
    update_dpr(2 * idx, lo, mid, st, en, vl);
  else if (st > mid)
    update_dpr(2 * idx + 1, mid + 1, hi, st, en, vl);
  else {
    update_dpr(2 * idx, lo, mid, st, mid, vl);
    update_dpr(2 * idx + 1, mid + 1, hi, mid + 1, en, vl);
  }
  dpr[idx] =
      max(dpr[2 * idx] + pdpr[2 * idx], dpr[2 * idx + 1] + pdpr[2 * idx + 1]);
}
int query_dpr(int idx, int lo, int hi, int st, int en) {
  if (lo == st && hi == en) return dpr[idx] + pdpr[idx];
  if (pdpr[idx]) lazy_dpr(idx);
  int mid = (lo + hi) / 2;
  if (en <= mid)
    return query_dpr(2 * idx, lo, mid, st, en);
  else if (st > mid)
    return query_dpr(2 * idx + 1, mid + 1, hi, st, en);
  else
    return max(query_dpr(2 * idx, lo, mid, st, mid),
               query_dpr(2 * idx + 1, mid + 1, hi, mid + 1, en));
}
void lazy_ans(int idx) {
  ans[idx] += pans[idx];
  pans[2 * idx] += pans[idx];
  pans[2 * idx + 1] += pans[idx];
  pans[idx] = 0;
}
void update_ans(int idx, int lo, int hi, int st, int en, int vl) {
  if (lo == st && hi == en) {
    if (lo == hi)
      ans[idx] += vl;
    else
      pans[idx] += vl;
    return;
  }
  if (pans[idx]) lazy_ans(idx);
  int mid = (lo + hi) / 2;
  if (en <= mid)
    update_ans(2 * idx, lo, mid, st, en, vl);
  else if (st > mid)
    update_ans(2 * idx + 1, mid + 1, hi, st, en, vl);
  else {
    update_ans(2 * idx, lo, mid, st, mid, vl);
    update_ans(2 * idx + 1, mid + 1, hi, mid + 1, en, vl);
  }
  ans[idx] =
      max(ans[2 * idx] + pans[2 * idx], ans[2 * idx + 1] + pans[2 * idx + 1]);
}
int getSucc_dpl(int idx, int lo, int hi, int pos) {
  if (lo == hi) return lo;
  if (pdpl[idx]) lazy_dpl(idx);
  int mid = (lo + hi) / 2;
  if (lo != mid && pdpl[2 * idx])
    lazy_dpl(2 * idx);
  else if (pdpl[2 * idx]) {
    dpl[2 * idx] += pdpl[2 * idx];
    pdpl[2 * idx] = 0;
  }
  if (mid + 1 != hi && pdpl[2 * idx + 1])
    lazy_dpl(2 * idx + 1);
  else if (pdpl[2 * idx + 1]) {
    dpl[2 * idx + 1] += pdpl[2 * idx + 1];
    pdpl[2 * idx + 1] = 0;
  }
  if (dpl[2 * idx + 1] <= pos)
    return getSucc_dpl(2 * idx + 1, mid + 1, hi, pos);
  return getSucc_dpl(2 * idx, lo, mid, pos);
}
int getPred_dpr(int idx, int lo, int hi, int pos) {
  if (lo == hi) return lo;
  if (pdpr[idx]) lazy_dpr(idx);
  int mid = (lo + hi) / 2;
  if (lo != mid && pdpr[2 * idx])
    lazy_dpr(2 * idx);
  else if (pdpr[2 * idx]) {
    dpr[2 * idx] += pdpr[2 * idx];
    pdpr[2 * idx] = 0;
  }
  if (mid + 1 != hi && pdpr[2 * idx + 1])
    lazy_dpr(2 * idx + 1);
  else if (pdpr[2 * idx + 1]) {
    dpr[2 * idx + 1] += pdpr[2 * idx + 1];
    pdpr[2 * idx + 1] = 0;
  }
  if (dpr[2 * idx] >= pos) return getPred_dpr(2 * idx, lo, mid, pos);
  return getPred_dpr(2 * idx + 1, mid + 1, hi, pos);
}
bool alter_dpl(int pos, int d, int inc = -1) {
  if (pos == n + 1) return false;
  long long cur = query_val(1, 1, n, pos, pos);
  long long cpr = query_val(1, 1, n, pos - 1, pos - 1);
  bool happened = false;
  if (inc == -1) {
    if (cpr < cur && cpr + d >= cur) {
      happened = true;
      int tem = (pos - 1) - query_dpl(1, 1, n, pos - 1, pos - 1) + 1;
      int succ = getSucc_dpl(1, 1, n, pos);
      update_dpl(1, 1, n, pos, succ, tem);
      update_ans(1, 1, n, pos, succ, -tem);
    }
  } else {
    if (cpr < cur && cpr + d < cur) {
      happened = true;
      int succ = getSucc_dpl(1, 1, n, pos);
      update_dpl(1, 1, n, pos, succ, -inc);
      update_ans(1, 1, n, pos, succ, inc);
    }
  }
  return happened;
}
bool alter_dpr(int pos, int d, int inc = -1) {
  if (pos == 0) return false;
  long long cur = query_val(1, 1, n, pos, pos);
  long long csf = query_val(1, 1, n, pos + 1, pos + 1);
  bool happened = false;
  if (inc == -1) {
    if (csf < cur && csf + d >= cur) {
      happened = true;
      int tem = query_dpr(1, 1, n, pos + 1, pos + 1) - (pos + 1) + 1;
      int pred = getPred_dpr(1, 1, n, pos);
      update_dpr(1, 1, n, pred, pos, -tem);
      update_ans(1, 1, n, pred, pos, -tem);
    }
  } else {
    if (csf < cur && csf + d < cur) {
      happened = true;
      int pred = getPred_dpr(1, 1, n, pos);
      update_dpr(1, 1, n, pred, pos, inc);
      update_ans(1, 1, n, pred, pos, inc);
    }
  }
  return happened;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    if (a[i] > a[i - 1])
      dp1[i] = 1 + dp1[i - 1];
    else
      dp1[i] = 1;
    fin[i] = dp1[i] - 1;
  }
  for (int i = n; i >= 1; i--) {
    if (a[i] > a[i + 1])
      dp2[i] = 1 + dp2[i + 1];
    else
      dp2[i] = 1;
    fin[i] += dp2[i];
  }
  for (int i = 0; i <= 3; ++i) build(1, 1, n, i);
  int m;
  cin >> m;
  while (m--) {
    int l, r, d;
    cin >> l >> r >> d;
    long long cpr = query_val(1, 1, n, l - 1, l - 1);
    long long cur = query_val(1, 1, n, l, l);
    if (cur > cpr || (cur <= cpr && cur + d <= cpr))
      alter_dpl(r + 1, d);
    else {
      int succ = getSucc_dpl(1, 1, n, l);
      int tem = (l - 1) - query_dpl(1, 1, n, l - 1, l - 1) + 1;
      if (succ <= r) {
        update_dpl(1, 1, n, l, succ, -tem);
        update_ans(1, 1, n, l, succ, tem);
        alter_dpl(r + 1, d);
      } else {
        bool happened = alter_dpl(r + 1, d);
        update_dpl(1, 1, n, l, r, -tem);
        update_ans(1, 1, n, l, r, tem);
        if (!happened) alter_dpl(r + 1, d, tem);
      }
    }
    long long csf = query_val(1, 1, n, r + 1, r + 1);
    cur = query_val(1, 1, n, r, r);
    if (cur > csf || (cur <= csf && cur + d <= csf))
      alter_dpr(l - 1, d);
    else {
      int pred = getPred_dpr(1, 1, n, r);
      int tem = query_dpr(1, 1, n, r + 1, r + 1) - (r + 1) + 1;
      if (pred >= l) {
        update_dpr(1, 1, n, pred, r, tem);
        update_ans(1, 1, n, pred, r, tem);
        alter_dpr(l - 1, d);
      } else {
        bool happened = alter_dpr(l - 1, d);
        update_dpr(1, 1, n, l, r, tem);
        update_ans(1, 1, n, l, r, tem);
        if (!happened) alter_dpr(l - 1, d, tem);
      }
    }
    update_val(1, 1, n, l, r, (long long)d);
    lazy_ans(1);
    cout << ans[1] << '\n';
  }
}
