#include <bits/stdc++.h>
using namespace std;
const int UPR = 0, UPL = 1, DWR = 2, DWL = 3;
int n;
int sum(pair<int, int> i) { return i.first + i.second; }
pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {
  return {a.first + b.first, a.second + b.second};
}
pair<int, int> maxii(pair<int, int> a, pair<int, int> b) {
  if (sum(a) > sum(b))
    return a;
  else
    return b;
}
long long ft[300003];
void add(int x, long long val) {
  for (; x <= n; x += (x & -x)) ft[x] += val;
}
void add(int x, int y, long long val) { add(x, val), add(y + 1, -val); }
long long arr(int x) { return (x == 0) ? 0 : ft[x] + arr(x - (x & -x)); }
int tree[1200003][4], lazy[1200003][4];
void cek_lazy(int pos, int kir, int kan, int tipe) {
  if (lazy[pos][tipe]) {
    tree[pos][tipe] = lazy[pos][tipe];
    if (kir != kan) {
      lazy[pos * 2][tipe] = lazy[pos][tipe];
      lazy[pos * 2 + 1][tipe] = lazy[pos][tipe];
    }
    lazy[pos][tipe] = 0;
  }
}
void update(int pos, int kir, int kan, int qkir, int qkan, int val, int tipe) {
  cek_lazy(pos, kir, kan, tipe);
  if (qkir <= kir && kan <= qkan) {
    tree[pos][tipe] = val;
    if (kir != kan) {
      lazy[pos * 2][tipe] = val;
      lazy[pos * 2 + 1][tipe] = val;
    }
  } else if (qkir > kan || kir > qkan)
    return;
  else {
    update(pos * 2, kir, (kir + kan) / 2, qkir, qkan, val, tipe);
    update(pos * 2 + 1, (kir + kan) / 2 + 1, kan, qkir, qkan, val, tipe);
  }
}
void update(int tipe, int kir, int kan, int val) {
  update(1, 1, n, kir, kan, val, tipe);
}
int query(int pos, int kir, int kan, int idx, int tipe) {
  cek_lazy(pos, kir, kan, tipe);
  if (kir == idx && idx == kan)
    return tree[pos][tipe];
  else if (kan < idx || kir > idx)
    return -1;
  else
    return max(query(pos * 2, kir, (kir + kan) / 2, idx, tipe),
               query(pos * 2 + 1, (kir + kan) / 2 + 1, kan, idx, tipe));
}
int query(int tipe, int idx) { return query(1, 1, n, idx, tipe); }
pair<int, int> atree[1200003], alazy[1200003];
void cek_alazy(int pos, int kir, int kan) {
  if (alazy[pos] != pair<int, int>(0, 0)) {
    atree[pos] = atree[pos] + alazy[pos];
    if (kir != kan) {
      alazy[pos * 2] = alazy[pos * 2] + alazy[pos];
      alazy[pos * 2 + 1] = alazy[pos * 2 + 1] + alazy[pos];
    }
    alazy[pos] = {0, 0};
  }
}
void update_ans(int pos, int kir, int kan, int qkir, int qkan,
                pair<int, int> val) {
  cek_alazy(pos, kir, kan);
  if (qkir <= kir && kan <= qkan) {
    atree[pos] = atree[pos] + val;
    if (kir != kan) {
      alazy[pos * 2] = alazy[pos * 2] + val;
      alazy[pos * 2 + 1] = alazy[pos * 2 + 1] + val;
    }
  } else if (qkir > kan || kir > qkan)
    return;
  else {
    update_ans(pos * 2, kir, (kir + kan) / 2, qkir, qkan, val);
    update_ans(pos * 2 + 1, (kir + kan) / 2 + 1, kan, qkir, qkan, val);
    atree[pos] = maxii(atree[pos * 2 + 1], atree[pos * 2]);
  }
}
void update_ans(int kir, int kan, pair<int, int> val) {
  update_ans(1, 1, n, kir, kan, val);
}
pair<int, int> query_ans(int pos, int kir, int kan, int qkir, int qkan) {
  cek_alazy(pos, kir, kan);
  if (qkir <= kir && kan <= qkan)
    return atree[pos];
  else if (kan < qkir || kir > qkan)
    return pair<int, int>(0, 0);
  else
    return max(query_ans(pos * 2, kir, (kir + kan) / 2, qkir, qkan),
               query_ans(pos * 2 + 1, (kir + kan) / 2 + 1, kan, qkir, qkan));
}
void print_tree() {
  printf("ANSfi: ");
  for (int i = 1; i <= n; i++) printf("%d ", query_ans(1, 1, n, i, i).first);
  printf("\n");
  printf("ANSse: ");
  for (int i = 1; i <= n; i++) printf("%d ", query_ans(1, 1, n, i, i).second);
  printf("\n");
  printf("ARR  : ");
  for (int i = 1; i <= n; i++) printf("%lld ", arr(i));
  printf("\n");
  printf("UPR  : ");
  for (int i = 1; i <= n; i++) printf("%d ", query(UPR, i));
  printf("\n");
  printf("UPL  : ");
  for (int i = 1; i <= n; i++) printf("%d ", query(UPL, i));
  printf("\n");
  printf("DWR  : ");
  for (int i = 1; i <= n; i++) printf("%d ", query(DWR, i));
  printf("\n");
  printf("DWL  : ");
  for (int i = 1; i <= n; i++) printf("%d ", query(DWL, i));
  printf("\n");
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    add(i, i, x);
  }
  int ki = 1, ka = n;
  for (int i = 1; i < n; i++) {
    if (arr(i) >= arr(i + 1)) {
      update(UPR, ki, i, i);
      update(DWL, ki, i, ki);
      ki = i + 1;
    }
  }
  update(UPR, ki, n, n);
  update(DWL, ki, n, ki);
  for (int i = n; i > 1; i--) {
    if (arr(i) >= arr(i - 1)) {
      update(UPL, i, ka, i);
      update(DWR, i, ka, ka);
      ka = i - 1;
    }
  }
  update(UPL, 1, ka, 1);
  update(DWR, 1, ka, ka);
  for (int i = 1; i <= n; i++)
    update_ans(i, i, {i - query(DWL, i) + 1, query(DWR, i) - i + 1});
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r;
    long long val;
    scanf("%d %d %lld", &l, &r, &val);
    if (l > 1) {
      int leu = query(UPL, l - 1);
      int led = query(DWL, l - 1);
      int riu = query(UPR, l);
      int rid = query(DWR, l);
      long long L = arr(l);
      long long LM1 = arr(l - 1);
      if (L < LM1 && L + val >= LM1) {
        update(UPL, l, rid, l);
        update(DWR, leu, l - 1, l - 1);
        update_ans(leu, l - 1, {0, -(rid - l + 1)});
      }
      if (L + val > LM1 && L <= LM1) {
        update(UPR, led, riu, riu);
        update(DWL, led, riu, led);
        update_ans(l, riu, {l - led, 0});
      }
    }
    if (r < n) {
      int leu = query(UPL, r);
      int led = query(DWL, r);
      int riu = query(UPR, r + 1);
      int rid = query(DWR, r + 1);
      long long R = arr(r);
      long long RP1 = arr(r + 1);
      if (R < RP1 && R + val >= RP1) {
        update(UPR, led, r, r);
        update(DWL, r + 1, riu, r + 1);
        update_ans(r + 1, riu, {-(r - led + 1), 0});
      }
      if (R + val > RP1 && R <= RP1) {
        update(UPL, leu, rid, leu);
        update(DWR, leu, rid, rid);
        update_ans(leu, r, {0, rid - r});
      }
    }
    add(l, r, val);
    printf("%d\n", sum(atree[1]) - 1);
  }
}
