#include <bits/stdc++.h>
using namespace std;
const int INF = 2139062143;
inline long long read() {
  long long f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch > '9' || ch < '0');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
const int MAX_N = 3E5 + 50;
struct Node {
  long long len, lc, rc, lmax, rmax, dat, l_line, r_line;
};
Node operator+(const Node a, const Node b) {
  Node c;
  c.len = a.len + b.len;
  c.lc = a.lc;
  c.rc = b.rc;
  c.l_line = a.l_line;
  if (a.l_line == a.len && a.rc > b.lc)
    c.l_line = max(c.l_line, a.l_line + b.l_line);
  c.r_line = b.r_line;
  if (b.r_line == b.len && a.rc < b.lc)
    c.r_line = max(c.r_line, a.r_line + b.r_line);
  c.lmax = a.lmax;
  c.rmax = b.rmax;
  if (a.lmax == a.len && a.rc > b.lc) c.lmax = max(c.lmax, a.lmax + b.l_line);
  if (a.r_line == a.len && a.rc < b.lc) c.lmax = max(c.lmax, a.r_line + b.lmax);
  if (c.rmax == b.len && a.rc < b.lc) c.rmax += a.r_line;
  if (b.l_line == b.len && a.rc > b.lc) c.rmax = max(c.rmax, b.l_line + a.rmax);
  c.dat = max(a.dat, b.dat);
  if (a.rc > b.lc) c.dat = max(c.dat, a.rmax + b.l_line);
  if (a.rc < b.lc) c.dat = max(c.dat, b.lmax + a.r_line);
  return c;
}
int n, a[MAX_N], m;
struct segment_tree {
  int l, r;
  long long tag;
  Node x;
} t[MAX_N << 2];
void build(int p, int l, int r) {
  t[p].l = l;
  t[p].r = r;
  if (l == r) {
    t[p].x.lc = t[p].x.rc = a[l];
    t[p].x.len = t[p].x.lmax = t[p].x.rmax = t[p].x.dat = t[p].x.l_line =
        t[p].x.r_line = 1;
    return;
  }
  int mid = (l + r) >> 1;
  build((p << 1), l, mid);
  build((p << 1 | 1), mid + 1, r);
  t[p].x = t[(p << 1)].x + t[(p << 1 | 1)].x;
}
void push_down(int p) {
  if (t[p].tag == 0) return;
  t[(p << 1)].x.lc += t[p].tag;
  t[(p << 1 | 1)].x.rc += t[p].tag;
  t[(p << 1)].x.rc += t[p].tag;
  t[(p << 1 | 1)].x.lc += t[p].tag;
  t[(p << 1)].tag += t[p].tag;
  t[(p << 1 | 1)].tag += t[p].tag;
  t[p].tag = 0;
}
void change(int p, int l, int r, int v) {
  if (l <= t[p].l && t[p].r <= r) {
    t[p].x.lc += v;
    t[p].x.rc += v;
    t[p].tag += v;
    return;
  }
  push_down(p);
  int mid = (t[p].l + t[p].r) >> 1;
  if (l <= mid) change((p << 1), l, r, v);
  if (r > mid) change((p << 1 | 1), l, r, v);
  t[p].x = t[(p << 1)].x + t[(p << 1 | 1)].x;
}
inline Node query(int p, int l, int r) {
  if (l <= t[p].l && t[p].r <= r) return t[p].x;
  push_down(p);
  int mid = (t[p].l + t[p].r) >> 1;
  if (r <= mid) return query((p << 1), l, r);
  if (l > mid) return query((p << 1 | 1), l, r);
  Node a = query((p << 1), l, r), b = query((p << 1 | 1), l, r);
  return a + b;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  build(1, 1, n);
  m = read();
  for (int i = 1; i <= m; i++) {
    int l = read(), r = read(), d = read();
    change(1, l, r, d);
    printf("%lld\n", query(1, 1, n).dat);
  }
  return 0;
}
