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.*;
import java.util.*;

/*
Прокрастинирую
*/

public class Main {

    static FastReader in;
    static PrintWriter out;
    static Random rand = new Random();
    static final int INF = (int) (1e9 + 10);
    static final int MOD = (int) (1e9 + 7);
    static final int N = (int) (1e5 + 5);
    static final int LOGN = 30;

    static class SegTree {
        long[] t_arr;
        int t_sz;
        class Node {
            int ans_l, ans_r, ans;

            Node() {
                ans_l = ans_r = ans = 0;
            }
        }
        Node[] t;

        SegTree() {
        }

        void pull(int v, int tl, int tm, int tr) {
            int sign1 = Long.signum(t_arr[tm]);
            int sign2 = Long.signum(t_arr[tm + 1]);
            if (sign1 >= sign2 && sign1 != 0 && sign2 != 0) {
                t[v].ans_l = t[v * 2 + 1].ans_l;
                if (t[v * 2 + 1].ans_l == tm - tl + 1) {
                    t[v].ans_l += t[v * 2 + 2].ans_l;
                }
                t[v].ans_r = t[v * 2 + 2].ans_r;
                if (t[v * 2 + 2].ans_r == tr - tm) {
                    t[v].ans_r += t[v * 2 + 1].ans_r;
                }
                t[v].ans = Math.max(Math.max(t[v * 2 + 1].ans, t[v * 2 + 2].ans),
                        t[v * 2 + 1].ans_r + t[v * 2 + 2].ans_l);
            } else {
                t[v].ans_l = t[v * 2 + 1].ans_l;
                t[v].ans_r = t[v * 2 + 2].ans_r;
                t[v].ans = Math.max(t[v * 2 + 1].ans, t[v * 2 + 2].ans);
            }
        }

        void build(long[] arr) {
            t_arr = arr;
            t_sz = t_arr.length;
            t = new Node[t_sz * 4];
            if (t_sz > 1) {
                build(0, 1, t_sz - 1);
            } else {
                t[0] = new Node();
            }
        }
        void build(int v, int tl, int tr) {
            if (tl == tr) {
                int sign = Long.signum(t_arr[tl]);
                t[v] = new Node();
                t[v].ans_l = t[v].ans_r = t[v].ans = (sign == 0) ? 0 : 1;
                return;
            }
            int tm = (tl + tr) / 2;
            build(v * 2 + 1, tl, tm);
            build(v * 2 + 2, tm + 1, tr);
            t[v] = new Node();
            pull(v, tl, tm, tr);
        }

        void upd(int v, int tl, int tr, int i, int d) {
            if (tl == tr) {
                t_arr[tl] += d;
                int sign = Long.signum(t_arr[tl]);
                t[v].ans_l = t[v].ans_r = t[v].ans = (sign == 0) ? 0 : 1;
                return;
            }
            int tm = (tl + tr) / 2;
            if (i <= tm) {
                upd(v * 2 + 1, tl, tm, i, d);
            } else {
                upd(v * 2 + 2, tm + 1, tr, i, d);
            }
            pull(v, tl, tm, tr);
        }
        void upd(int i, int d) {
            upd(0, 1, t_sz - 1, i, d);
        }
    }

    static void solve() {
        int n = in.nextInt();

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        long[] arr = new long[n];
        arr[0] = a[0];
        for (int i = 1; i < n; i++) {
            arr[i] = a[i] - a[i - 1];
        }

        SegTree st = new SegTree();
        st.build(arr);

//        out.println(st.t[0].ans + " " + st.t[0].ans_l + " " + st.t[0].ans_r);

        int m = in.nextInt();
        for (int i = 0; i < m; i++) {
            int l = in.nextInt() - 1;
            int r = in.nextInt() - 1;
            int d = in.nextInt();
            if (l != 0) {
                st.upd(l, d);
            }
            if (r != n - 1) {
                st.upd(r + 1, -d);
            }
            out.println(st.t[0].ans + 1);
        }
    }

    public static void main(String[] args) throws FileNotFoundException {
        in = new FastReader(System.in);
//        in = new FastReader(new FileInputStream("connect.in"));
        out = new PrintWriter(System.out);
//        out = new PrintWriter(new FileOutputStream("connect.out"));


        int q = 1;
//        q = in.nextInt();

        while (q-- > 0) {
            solve();
        }

        out.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

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

        Long nextLong() {
            return Long.parseLong(next());
        }

        Double nextDouble() {
            return Double.parseDouble(next());
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }
}