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 N = 300005;
struct ban {
  long long laz;
  int e;
  int maxs, maxl, maxr;
  int nl, nr;
  long long l, r;
  void nor(long long x) {
    laz = 0;
    e = 1;
    maxs = maxl = maxr = 1;
    nl = nr = 1;
    l = r = x;
  }
  void mer(const ban& ll, const ban& rr) {
    e = ll.e + rr.e;
    maxs = max(ll.maxs, rr.maxs);
    maxl = ll.maxl;
    maxr = rr.maxr;
    nl = ll.nl;
    nr = rr.nr;
    l = ll.l;
    r = rr.r;
    if (ll.r > rr.l) {
      maxs = max(maxs, ll.maxr + rr.nl);
      if (ll.maxr == ll.e) maxl = ll.maxr + rr.nl;
      if (rr.nl == rr.e) maxr = ll.maxr + rr.nl;
    }
    if (rr.l > ll.r) {
      maxs = max(maxs, rr.maxl + ll.nr);
      if (rr.maxl == rr.e) maxr = rr.maxl + ll.nr;
      if (ll.nr == ll.e) maxl = rr.maxl + ll.nr;
    }
    if (ll.nl == ll.e && ll.r > rr.l) nl = ll.nl + rr.nl;
    if (rr.nr == rr.e && rr.l > ll.r) nr = rr.nr + ll.nr;
  }
};
int n;
long long a[N];
ban t[N * 4];
void shi(int pos) {
  if (t[pos].laz == 0) return;
  t[pos].l += t[pos].laz;
  t[pos].r += t[pos].laz;
  if (t[pos].e > 1) {
    t[pos * 2].laz += t[pos].laz;
    t[pos * 2 + 1].laz += t[pos].laz;
  }
  t[pos].laz = 0;
}
ban crt(ban u) {
  u.l += u.laz;
  u.r += u.laz;
  return u;
}
void bil(int tl, int tr, int pos) {
  if (tl == tr) {
    t[pos].nor(a[tl]);
    return;
  }
  int m = (tl + tr) / 2;
  bil(tl, m, pos * 2);
  bil(m + 1, tr, pos * 2 + 1);
  t[pos].mer(crt(t[pos * 2]), crt(t[pos * 2 + 1]));
}
void ubd(int tl, int tr, int l, int r, long long g, int pos) {
  if (tl == l && tr == r) {
    t[pos].laz += g;
    return;
  }
  shi(pos);
  int m = (tl + tr) / 2;
  if (r <= m)
    ubd(tl, m, l, r, g, pos * 2);
  else if (l > m)
    ubd(m + 1, tr, l, r, g, pos * 2 + 1);
  else {
    ubd(tl, m, l, m, g, pos * 2);
    ubd(m + 1, tr, m + 1, r, g, pos * 2 + 1);
  }
  t[pos].mer(crt(t[pos * 2]), crt(t[pos * 2 + 1]));
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  bil(1, n, 1);
  int q;
  cin >> q;
  while (q--) {
    int l, r, g;
    cin >> l >> r >> g;
    ubd(1, n, l, r, g, 1);
    cout << t[1].maxs << endl;
  }
  return 0;
}
