Alyona has built n towers by putting small cubes some on the top of others. Each cube has size 1 × 1 × 1. A tower is a non-zero amount of cubes standing on the top of each other. The towers are next to each other, forming a row.

Sometimes Alyona chooses some segment towers, and put on the top of each tower several cubes. Formally, Alyouna chooses some segment of towers from li to ri and adds di cubes on the top of them.

Let the sequence a1, a2, ..., an be the heights of the towers from left to right. Let's call as a segment of towers al, al + 1, ..., ar a hill if the following condition holds: there is integer k (l ≤ k ≤ r) such that al < al + 1 < al + 2 < ... < ak > ak + 1 > ak + 2 > ... > ar.

After each addition of di cubes on the top of the towers from li to ri, Alyona wants to know the maximum width among all hills. The width of a hill is the number of towers in it.

Input

The first line contain single integer n (1 ≤ n ≤ 3·105) — the number of towers.

The second line contain n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the number of cubes in each tower. 

The third line contain single integer m (1 ≤ m ≤ 3·105) — the number of additions.

The next m lines contain 3 integers each. The i-th of these lines contains integers li, ri and di (1 ≤ l ≤ r ≤ n, 1 ≤ di ≤ 109), that mean that Alyona puts di cubes on the tio of each of the towers from li to ri.

Output

Print m lines. In i-th line print the maximum width of the hills after the i-th addition.

Example

Input

5
5 5 5 5 5
3
1 3 2
2 2 1
4 4 1


Output

2
4
5

Note

The first sample is as follows:

After addition of 2 cubes on the top of each towers from the first to the third, the number of cubes in the towers become equal to [7, 7, 7, 5, 5]. The hill with maximum width is [7, 5], thus the maximum width is 2.

After addition of 1 cube on the second tower, the number of cubes in the towers become equal to [7, 8, 7, 5, 5]. The hill with maximum width is now [7, 8, 7, 5], thus the maximum width is 4.

After addition of 1 cube on the fourth tower, the number of cubes in the towers become equal to [7, 8, 7, 6, 5]. The hill with maximum width is now [7, 8, 7, 6, 5], thus the maximum width is 5.
#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);
  }
}
