#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 2;
int n, q, l, r, ar[N], x;
struct st {
  long long pr, sf, prr, sff, mx, must, sl, pl, l;
  st() { l = pr = sf = prr = sff = mx = must = sl = pl = 0; }
};
st t[N * 4];
inline st combine(st a, st b) {
  st c;
  c.pr = a.pr;
  c.sf = b.sf;
  if (a.l == 1)
    c.prr = b.pr;
  else
    c.prr = a.prr;
  if (b.l == 1)
    c.sff = a.sf;
  else
    c.sff = b.sff;
  c.l = a.l + b.l;
  c.mx = max(a.mx, b.mx);
  c.pl = a.pl;
  c.sl = b.sl;
  int t1 = 0, t2 = 0;
  if (a.sf < a.sff) t1 = 1;
  if (a.sf > a.sff) t1 = 2;
  if (b.pr > b.prr) t2 = 1;
  if (b.pr < b.prr) t2 = 2;
  if (a.sf < b.pr) {
    if (t1 != 1) {
      c.mx = max(c.mx, a.sl + b.pl);
      if (a.sl == a.l) c.pl += b.pl;
      if (b.pl == b.l) c.sl += a.sl;
    } else {
      c.mx = max(c.mx, b.pl + 1);
      if (b.pl == b.l) c.sl++;
    }
  }
  if (a.sf > b.pr) {
    if (t2 != 2) {
      c.mx = max(c.mx, a.sl + b.pl);
      if (a.sl == a.l) c.pl += b.pl;
      if (b.pl == b.l) c.sl += a.sl;
    } else {
      c.mx = max(c.mx, a.sl + 1);
      if (a.sl == a.l) c.pl++;
    }
  }
  return c;
}
void build(int v = 1, int tl = 1, int tr = n) {
  if (tl == tr) {
    t[v].pl = t[v].sl = t[v].l = t[v].mx = 1;
    t[v].sf = t[v].sff = t[v].pr = t[v].prr = ar[tl];
  } else {
    int tm = (tl + tr) >> 1;
    build(v + v, tl, tm);
    build(v + v + 1, tm + 1, tr);
    t[v] = combine(t[v + v], t[v + v + 1]);
  }
}
inline void push(int v, int tl, int tr) {
  t[v].pr += t[v].must;
  t[v].prr += t[v].must;
  t[v].sf += t[v].must;
  t[v].sff += t[v].must;
  if (tl != tr) {
    t[v + v].must += t[v].must;
    t[v + v + 1].must += t[v].must;
  }
  t[v].must = 0;
}
inline void update(int l, int r, int x, int v = 1, int tl = 1, int tr = n) {
  push(v, tl, tr);
  if (l > r || l > tr || tl > r) return;
  if (l == tl && r == tr) {
    t[v].must = x;
    push(v, tl, tr);
    return;
  }
  int tm = (tl + tr) >> 1;
  update(l, min(tm, r), x, v + v, tl, tm);
  update(max(l, tm + 1), r, x, v + v + 1, tm + 1, tr);
  t[v] = combine(t[v + v], t[v + v + 1]);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", ar + i);
  build();
  cin >> q;
  while (q--) {
    scanf("%d%d%d", &l, &r, &x);
    update(l, r, x);
    printf("%I64d\n", t[1].mx);
  }
}
