#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long LINF = 2e18;
void inv(bool e);
template <typename T>
T sign(T a);
template <typename T>
void die(T& a);
template <typename T>
void umax(T& a, T b);
template <typename T>
void umin(T& a, T b);
bool brute, alter;
int cnt_tests = 1;
struct Q {
  int l, r;
  long long val;
  Q() {}
  Q(int a, int b, long long c) {
    l = a;
    r = b;
    val = c;
  }
};
int n, m;
vector<long long> arr;
void inp() {
  scanf("%d", &n);
  arr.resize(n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &arr[i]);
  }
  cin >> m;
}
struct Item {
  bool zero;
  int l, r;
  int cnt[4] = {0, 0, 0, 0};
  Item() {}
  Item(int ll, int rr, int val) {
    zero = !val;
    l = ll;
    r = rr;
    cnt[val] = 1;
  }
};
pair<bool, Item> merge_items(Item a, Item b) {
  Item c;
  if (a.cnt[0] != 0 && b.cnt[0] != 0) return {false, a};
  if (a.cnt[0] != 0) return {false, b};
  if (b.cnt[0] != 0) return {false, a};
  if (a.cnt[2] == 0 || b.cnt[1] == 0) {
    c = a;
    c.r = b.r;
    c.cnt[2] += b.cnt[2];
    c.cnt[1] += b.cnt[1];
    return {true, c};
  }
  if (a.r - a.l > b.r - b.l) return {false, a};
  return {false, b};
}
struct Node {
  int ans = 0;
  Item l, r, m;
  void normalize() {
    if (m.l == l.l) l = m;
    if (m.r == r.r) r = m;
  }
  Node() {}
  Node(Item un) {
    l = r = m = un;
    if (!un.zero) umax(ans, un.r - un.l + 1);
  }
  Node(Item ll, Item mm, Item rr) {
    l = ll;
    m = mm;
    r = rr;
    if (!l.zero) umax(ans, l.r - l.l + 1);
    if (!m.zero) umax(ans, m.r - m.l + 1);
    if (!r.zero) umax(ans, r.r - r.l + 1);
  }
};
Node merge_nodes(Node l, Node r) {
  Node res(l.l, l.l, r.r);
  umax(res.ans, l.ans);
  umax(res.ans, r.ans);
  if (l.r.r + 1 == r.l.l) {
    res.m = merge_items(l.r, r.l).second;
  } else {
    if (l.r.r - l.r.l > r.l.r - r.l.l)
      res.m = l.l;
    else
      res.m = r.r;
  }
  if (!res.m.zero) umax(res.ans, res.m.r - res.m.l + 1);
  res.normalize();
  return res;
}
template <typename T>
struct Segment_tree {
  vector<T> data, orig;
  vector<long long> lazy;
  T net;
  bool group = false;
  T (*f)(T a, T b);
  void push(int v, int l, int r) {
    if (!group) return;
    data[v] += lazy[v];
    if (l < r) {
      lazy[v + v + 1] += lazy[v];
      lazy[v + v + 2] += lazy[v];
    }
    lazy[v] = 0;
  }
  void build(int l, int r, int v) {
    if (l > r) return;
    if (l == r) {
      data[v] = orig[l];
      return;
    }
    int ls = v + v + 1, rs = v + v + 2, m = (l + r) >> 1;
    build(l, m, ls);
    build(m + 1, r, rs);
    data[v] = (*f)(data[ls], data[rs]);
  }
  void point_change(int pos, T val, int l, int r, int v) {
    if (pos > r || pos < l) return;
    if (l == r && pos == l) {
      data[v] = val;
      orig[pos] = val;
      return;
    }
    int ls = v + v + 1, rs = v + v + 2, m = (l + r) >> 1;
    point_change(pos, val, l, m, ls);
    point_change(pos, val, m + 1, r, rs);
    data[v] = (*f)(data[ls], data[rs]);
  }
  void point_change(int pos, T val) {
    point_change(pos, val, 0, ((int)(orig).size()) - 1, 0);
  }
  void group_change(int ql, int qr, T val, int l, int r, int v) {
    push(v, l, r);
    if (ql > r || qr < l) return;
    if (ql == l && r == qr) {
      lazy[v] += val;
      push(v, l, r);
      return;
    }
    int ls = v + v + 1, rs = v + v + 2, m = (l + r) >> 1;
    group_change(ql, min(qr, m), val, l, m, ls);
    group_change(max(ql, m + 1), qr, val, m + 1, r, rs);
    data[v] = (*f)(data[ls], data[rs]);
  }
  void group_change(int ql, int qr, T val) {
    group_change(ql, qr, val, 0, ((int)(orig).size()) - 1, 0);
  }
  T get(int ql, int qr, int l, int r, int v) {
    push(v, l, r);
    if (ql > r || qr < l) return net;
    if (ql == l && r == qr) {
      return data[v];
    }
    int ls = v + v + 1, rs = v + v + 2, m = (l + r) >> 1;
    T resL, resR;
    resL = get(ql, min(qr, m), l, m, ls);
    resR = get(max(ql, m + 1), qr, m + 1, r, rs);
    return (*f)(resL, resR);
  }
  T get(int ql, int qr) { return get(ql, qr, 0, ((int)(orig).size()) - 1, 0); }
  Segment_tree() {}
  Segment_tree(vector<T>& prot, T (*ff)(T a, T b), T nt) {
    net = nt;
    f = ff;
    orig = prot;
    data.resize(1 + 4 * ((int)(orig).size()), net);
    lazy.resize(1 + 4 * ((int)(orig).size()), 0);
    build(0, ((int)(orig).size()) - 1, 0);
  }
};
inline void change(Segment_tree<long long>& simple_tree,
                   Segment_tree<Node>& tree, vector<long long>& quick, int x) {
  long long r = simple_tree.get(x, x);
  long long l = simple_tree.get(x - 1, x - 1);
  int delta = (3 + sign(r - l)) % 3;
  if (quick[x - 1] != delta) {
    tree.point_change(x - 1, Node(Item(x - 1, x - 1, delta)));
    quick[x - 1] = delta;
  }
}
void solve() {
  vector<Node> base(n - 1);
  vector<long long> quick(n - 1);
  for (int i = 0; i < n - 1; i++) {
    int x = (3 + sign(arr[i + 1] - arr[i])) % 3;
    base[i] = Node(Item(i, i, x));
    quick[i] = x;
  }
  Segment_tree<Node> tree(base, merge_nodes, Node(Item(0, 0, 0)));
  Segment_tree<long long> simple_tree(
      arr, [](long long a, long long b) { return min(a, b); }, LINF);
  simple_tree.group = true;
  Q q;
  for (int i = 0; i < m; i++) {
    scanf("%d%d%I64d", &q.l, &q.r, &q.val);
    q.l--;
    q.r--;
    simple_tree.group_change(q.l, q.r, q.val);
    if (q.l > 0) {
      change(simple_tree, tree, quick, q.l);
    }
    if (q.r != n - 1) {
      change(simple_tree, tree, quick, q.r + 1);
    }
    printf("%d\n", tree.data[0].ans + 1);
  }
}
void stress() {}
void naive() {}
void run();
int main() {
  if (0) {
    freopen("stack.in", "r", stdin);
    freopen("stack.out", "w", stdout);
  }
  brute = false;
  for (int i = 0; (i < cnt_tests); i++) {
    run();
  }
  cerr << '\n' << "Time: " << clock() / 1000.0 << " ms";
  return 0;
}
void run() {
  if (!brute) {
    inp();
  } else {
    stress();
  }
  solve();
}
template <typename T>
void die(T& a) {
  cout << a;
  exit(0);
}
template <typename T>
T sign(T a) {
  if (a == 0) return 0;
  if (a < 0) return -1;
  return 1;
}
template <typename T>
void umax(T& a, T b) {
  if (b > a) a = b;
}
template <typename T>
void umin(T& a, T b) {
  if (b < a) a = b;
}
void inv(bool e) {
  if (!e) {
    vector<int> a;
    a[-1] += 1;
  }
}
