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.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AlyonaAndTours solver = new AlyonaAndTours();
        solver.solve(1, in, out);
        out.close();
    }

    static class AlyonaAndTours {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int[] arr = new int[N];
            long[] diff = new long[N - 1];
            for (int i = 0; i < N; i++) {
                int a = in.nextInt();
                arr[i] = a;
            }
            for (int i = 0; i < N - 1; i++) {
                diff[i] = arr[i + 1] - arr[i];
            }
            SegmentTree query = new SegmentTree(diff);
            int m = in.nextInt();
            while (m-- > 0) {
                int l = in.nextInt() - 1;
                int r = in.nextInt() - 1;
                int di = in.nextInt();
                if (N == 1) {
                    out.println(1);
                } else {
                    if (l != 0) {
                        query.add(l - 1, di);
                    }
                    if (r != N - 1) {
                        query.add(r, -di);
                    }
                    out.println(query.tree[1].max + 1);
                }
            }
        }

        public class SegmentTree {
            Node[] tree;
            long[] arr;
            int size = 0;

            public SegmentTree(long[] arr) {
                int N = arr.length;
                tree = new Node[4 * N];
                size = N;
                for (int i = 0; i < 4 * N; i++) {
                    tree[i] = new Node();
                }
                this.arr = new long[N];
                for (int i = 0; i < N; i++) {
                    this.add(i, arr[i]);
                }
            }

            Node combine(Node a, Node b, int l1, int r1, int l2, int r2) {
                //change when doing different operations
                Node res = new Node();
                if (Long.signum(arr[r1]) == 0 || Long.signum(arr[l2]) == 0 || Long.signum(arr[r1]) < Long.signum(arr[l2])) {
                    res.prefix = a.prefix;
                    res.suffix = b.suffix;
                    res.max = Math.max(a.max, b.max);
                } else {
                    if (a.prefix == r1 - l1 + 1) {
                        res.prefix = a.prefix + b.prefix;
                    } else {
                        res.prefix = a.prefix;
                    }
                    if (b.suffix == r2 - l2 + 1) {
                        res.suffix = b.suffix + a.suffix;
                    } else {
                        res.suffix = b.suffix;
                    }
                    res.max = Math.max(a.suffix + b.prefix, Math.max(a.max, b.max));
                }
                return res;
            }

            public void add(int i, long val) {
                //change query, not assignment
                addUtil(1, i, 0, size - 1, val);
            }

            public void addUtil(int n, int i, int tl, int tr, long val) {
                if (tl == tr) {
                    arr[i] += val;
                    tree[n] = new Node();
                    if (arr[i] != 0) {
                        tree[n].suffix = 1;
                        tree[n].max = 1;
                        tree[n].prefix = 1;
                    }
                } else {
                    int tm = (tl + tr) / 2;
                    if (tm >= i) {
                        addUtil(2 * n, i, tl, tm, val);
                    } else {
                        addUtil(2 * n + 1, i, tm + 1, tr, val);
                    }
                    tree[n] = combine(tree[2 * n], tree[2 * n + 1], tl, tm, tm + 1, tr);
                }
            }

            class Node {
                int prefix = 0;
                int suffix = 0;
                int max = 0;

            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

