In this task, Nastya asked us to write a formal statement.

An array a of length n and an array k of length n-1 are given. Two types of queries should be processed: 

  * increase a_i by x. Then if a_{i+1} < a_i + k_i, a_{i+1} becomes exactly a_i + k_i; again, if a_{i+2} < a_{i+1} + k_{i+1}, a_{i+2} becomes exactly a_{i+1} + k_{i+1}, and so far for a_{i+3}, ..., a_n; 
  * print the sum of the contiguous subarray from the l-th element to the r-th element of the array a. 



It's guaranteed that initially a_i + k_i ≤ a_{i+1} for all 1 ≤ i ≤ n-1.

Input

The first line contains a single integer n (2 ≤ n ≤ 10^{5}) — the number of elements in the array a.

The second line contains n integers a_1, a_2, …, a_n (-10^{9} ≤ a_i ≤ 10^{9}) — the elements of the array a.

The third line contains n-1 integers k_1, k_2, …, k_{n-1} (-10^{6} ≤ k_i ≤ 10^{6}) — the elements of the array k.

The fourth line contains a single integer q (1 ≤ q ≤ 10^{5}) — the number of queries.

Each of the following q lines contains a query of one of two types: 

  * if the query has the first type, the corresponding line contains the character '+' (without quotes), and then there are two integers i and x (1 ≤ i ≤ n, 0 ≤ x ≤ 10^{6}), it means that integer x is added to the i-th element of the array a as described in the statement. 
  * if the query has the second type, the corresponding line contains the character 's' (without quotes) and then there are two integers l and r (1 ≤ l ≤ r ≤ n). 

Output

For each query of the second type print a single integer in a new line — the sum of the corresponding subarray.

Examples

Input


3
1 2 3
1 -1
5
s 2 3
+ 1 2
s 1 2
+ 3 1
s 2 3


Output


5
7
8


Input


3
3 6 7
3 1
3
+ 1 3
+ 2 4
s 1 3


Output


33

Note

In the first example: 

  * after the first change a = [3, 4, 3]; 
  * after the second change a = [3, 4, 4]. 



In the second example: 

  * after the first change a = [6, 9, 10]; 
  * after the second change a = [6, 13, 14]. 
/**
 * @author derrick20
 */

import java.io.*;
import java.util.*;

public class NastyaWritten3DO {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        int N = sc.nextInt();
        long[] a = new long[N + 1];
        SegmentTree st = new SegmentTree(N + 1);

        long[] diffs = new long[N + 1];
        for (int i = 1; i <= N; i++) {
            a[i] = sc.nextLong();
//            st.update(i, i, a[i]);
//            System.out.println(Arrays.toString(st.delta));
//            System.out.println(Arrays.toString(st.treeSum));
            if (i > 1) {
                diffs[i] = diffs[i - 1] + a[i] - a[i - 1];
            }
        }

        // keep a prefix of the original a sequence.
        // now, we've removed a constant from the b sequence which will
        // represent the amount we go above the original a sequence.
        // So, combining them recovers the original
        long[] constant = new long[N + 1];
        long[] prefix = new long[N + 1];
        prefix[1] = constant[1] = a[1];
        long totalK = 0;
        for (int i = 2; i <= N; i++) {
            long k = sc.nextLong();
            totalK += k;
            constant[i] = constant[i - 1] + k;
            prefix[i] = prefix[i - 1] + constant[i];
            diffs[i] -= totalK;
            // place in the cumulative delta from start to here
            // so, now the array as a[0] + a[i] - a[0] - the built in k's. This gives a new
            // sequence whose resulting constraint is to be monotonic.
            st.update(i, i, diffs[i]);
        }
//        System.out.println(Arrays.toString(prefix));
        int Q = sc.nextInt();
        while (Q-- > 0) {
            char type = sc.next().charAt(0);
            if (type == '+') {
                int pos = sc.nextInt();
                long delta = sc.nextLong();
                long currVal = st.query(pos, pos, SUM);
                // the combined value must be leveled off going forward
//                st.print();
                int lo = pos;
                int hi = N;
                while (lo < hi) {
                    // find last position so that max of range is < delta. This means
                    // everything there in [pos, last] is incremented!
                    // 1100
                    int mid = (lo + hi + 1) / 2;
                    long maxDelta = st.query(pos, mid, MAX);
                    if (maxDelta < currVal + delta) {
                        lo = mid;
                    } else {
                        hi = mid - 1;
                    }
                }
                int end = lo;
                st.update(pos, end, currVal + delta);
            } else if (type == 's') {
                int l = sc.nextInt();
                int r = sc.nextInt();
                long sum = st.query(l, r, SUM);
                long init = prefix[r] - prefix[l - 1];
                out.println(sum + init);
            }
            out.flush();
        }
        out.close();
    }

    static int MAX = 0, SUM = 1;

    static class SegmentTree {
        long[] treeMax, treeSum, delta;
        int N;
        long IDMAX = (long) -9e18;
        long IDSUM = 0;

        public SegmentTree(int size) {
            N = size;
            treeMax = new long[4 * N];
            treeSum = new long[4 * N];
            delta = new long[4 * N];
        }

        public void print() {
            for (int n = 1; n < N; n++) {
                System.out.print(query(n, n, SUM) + " ");
            }
            System.out.println();
            for (int i = 1; i < N; i++) {
                System.out.print(query(i, i, MAX) + " ");
            }
            System.out.println();
        }

        public void update(int l, int r, long val) {
            updateHelper(1, 0, N - 1, l, r, val);
        }

        public void pushDown(int node) {
            if (delta[node] != 0) {
                delta[2 * node] = delta[node];
                delta[2 * node + 1] = delta[node];
                delta[node] = 0;
            }
        }

        public long evalMax(int node) {
            return delta[node] != 0 ? delta[node] : treeMax[node];
        }

        private void updateHelper(int node, int sl, int sr, int l, int r, long val) {
            if (sr < l || r < sl) return;
            else if (l <= sl && sr <= r) {
                delta[node] = val;
            } else {
                pushDown(node);
                int mid = (sl + sr) / 2;
                updateHelper(2 * node, sl, mid, l, r, val);
                updateHelper(2 * node + 1, mid + 1, sr, l, r, val);
                treeMax[node] = Math.max(evalMax(2 * node), evalMax(2 * node + 1));
                treeSum[node] = (delta[2 * node] != 0 ? (mid - sl + 1) * delta[2 * node] : treeSum[2 * node])
                        + (delta[2 * node + 1] != 0 ? (sr - mid) * delta[2 * node + 1] : treeSum[2 * node + 1]);
            }
        }

        public long query(int l, int r, int type) {
            return queryHelper(1, 0, N - 1, l, r, type);
        }

        private long queryHelper(int node, int sl, int sr, int l, int r, int type) {
            if (sr < l || r < sl) {
                return type == MAX ? IDMAX : IDSUM;
            } else if (l <= sl && sr <= r) {
                if (type == MAX) {
                    return evalMax(node);
                } else {
                    return delta[node] != 0 ? (sr - sl + 1) * delta[node] : treeSum[node];
                }
            } else {
                pushDown(node);
                int mid = (sl + sr) / 2;
                long left = queryHelper(2 * node, sl, mid, l, r, type);
                long right = queryHelper(2 * node + 1, mid + 1, sr, l, r, type);
                treeMax[node] = Math.max(evalMax(2 * node), evalMax(2 * node + 1));
                treeSum[node] = (delta[2 * node] != 0 ? (mid - sl + 1) * delta[2 * node] : treeSum[2 * node])
                        + (delta[2 * node + 1] != 0 ? (sr - mid) * delta[2 * node + 1] : treeSum[2 * node + 1]);
                long res = type == MAX ? Math.max(left, right) : left + right;
                return res;
            }
        }
    }

    static class FastScanner {
        private int BS = 1 << 16;
        private char NC = (char) 0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;

        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }

        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            } catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }

        private char getChar() {
            while (bId == size) {
                try {
                    size = in.read(buf);
                } catch (Exception e) {
                    return NC;
                }
                if (size == -1) return NC;
                bId = 0;
            }
            return (char) buf[bId++];
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public int[] nextInts(int N) {
            int[] res = new int[N];
            for (int i = 0; i < N; i++) {
                res[i] = (int) nextLong();
            }
            return res;
        }

        public long[] nextLongs(int N) {
            long[] res = new long[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextLong();
            }
            return res;
        }

        public long nextLong() {
            cnt = 1;
            boolean neg = false;
            if (c == NC) c = getChar();
            for (; (c < '0' || c > '9'); c = getChar()) {
                if (c == '-') neg = true;
            }
            long res = 0;
            for (; c >= '0' && c <= '9'; c = getChar()) {
                res = (res << 3) + (res << 1) + c - '0';
                cnt *= 10;
            }
            return neg ? -res : res;
        }

        public double nextDouble() {
            double cur = nextLong();
            return c != '.' ? cur : cur + nextLong() / cnt;
        }

        public double[] nextDoubles(int N) {
            double[] res = new double[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextDouble();
            }
            return res;
        }

        public String next() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c > 32) {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public String nextLine() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c != '\n') {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public boolean hasNext() {
            if (c > 32) return true;
            while (true) {
                c = getChar();
                if (c == NC) return false;
                else if (c > 32) return true;
            }
        }
    }

    static void ASSERT(boolean assertion, String message) {
        if (!assertion) throw new AssertionError(message);
    }
}