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]. 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.PrintWriter;
public class E1136 
{
    static long pf[];
    static long pfap[];
    static int n;
    static long sum(int l,int r){
        if(r<l)
            return 0;
        return pf[r]-pf[l-1];
    }
    static long sumap(int l,int r){
        if(r<l)
            return 0;
        return (pfap[r]-pfap[l-1])-(n-r-1)*(pf[r]-pf[l-1]);
    }
    static void init(long k[]){
        n=k.length;
        pf=new long[n];
        pfap=new long[n];
        for(int i=1;i<n;i++){
            pf[i]=pf[i-1]+k[i];
            pfap[i]=pfap[i-1]+(n-i)*k[i];
        }
    }
    static class SegmentTree
    {
        int n;
        long tree[];
        int start[];
        int end[];
        long lazyv[];
        int lazys[];
        boolean lazy[];
        public SegmentTree(long a[])
        {
            n=a.length-1;
            tree=new long[4*n+1];
            start=new int[4*n+1];
            end=new int[4*n+1];
            lazyv=new long[4*n+1];
            lazys=new int[4*n+1];
            lazy=new boolean[4*n+1];
            initialize(1,1,n,a);
        }
        void initialize(int node,int s,int e,long a[])
        {
            start[node]=s;
            end[node]=e;
            if(s==e)
            {
                tree[node]=a[s];
                return;
            }
            
            int mid=(s+e)>>1;
            initialize(node<<1,s,mid,a);
            initialize((node<<1)|1,mid+1,e,a);
            tree[node]=tree[(node<<1)]+tree[(node<<1)|1];
        }
        void lazyPropagation(int node)
        {
            if(!lazy[node])
                return;
            lazy[node]=false;
            
            lazy[node<<1]=lazy[(node<<1)|1]=true;
            lazyv[node<<1]=lazyv[(node<<1)|1]=lazyv[node];
            lazys[node<<1]=lazys[(node<<1)|1]=lazys[node];
        }
        void update(int node)
        {
            long leftValue=tree[node<<1];
            if(lazy[node<<1]){
                long startValue=lazyv[node<<1]+E1136.sum(lazys[node<<1],start[node<<1]-1);
                leftValue=startValue*(end[node<<1]-start[node<<1]+1)+E1136.sumap(start[node<<1],end[node<<1]-1);
            }
            long rightValue=tree[(node<<1)|1];
            if(lazy[(node<<1)|1]){
                long startValue=lazyv[(node<<1)|1]+E1136.sum(lazys[(node<<1)|1],start[(node<<1)|1]-1);
                rightValue=startValue*(end[(node<<1)|1]-start[(node<<1)|1]+1)+E1136.sumap(start[(node<<1)|1],end[(node<<1)|1]-1);
            }
            tree[node]=leftValue+rightValue;
        }
        void incrementRange(int l,int r,long sv, int si)
        {
            incrementRange(1,l,r,sv,si);
        }   
        void incrementRange(int node,int l,int r,long sv, int si)
        {
            if(start[node]>r||end[node]<l)
                return;
            if(start[node]>=l&&end[node]<=r)
            {
                lazy[node]=true;
                lazyv[node]=sv;
                lazys[node]=si;
                return;
            }
            lazyPropagation(node);
            incrementRange(node<<1,l,r,sv,si);
            incrementRange((node<<1)|1,l,r,sv,si);
            update(node);
        }
        long query(int l,int r)
        {
            return query(1,l,r);
        }
        long query(int node,int l,int r)
        {
            if(start[node]>r||end[node]<l)
                return 0;
            if(start[node]>=l&&end[node]<=r)
            {
                if(!lazy[node])
                    return tree[node];
                long startValue=lazyv[node]+E1136.sum(lazys[node], start[node]-1);
                return startValue*(end[node]-start[node]+1)+E1136.sumap(start[node],end[node]-1);
            }
            lazyPropagation(node);
            long leftValue=query(node<<1,l,r);
            long rightValue=query((node<<1)|1,l,r);
            update(node);
            return leftValue+rightValue;
        }
    }
    static class Scanner
    {
        BufferedReader br;
        StringTokenizer tk=new StringTokenizer("");
        public Scanner(InputStream is) 
        {
            br=new BufferedReader(new InputStreamReader(is));
        }
        public int nextInt() throws IOException
        {
            if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
                return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
            if(tk.hasMoreTokens())
                return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
            tk=new StringTokenizer("");
            return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
                return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
                return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
                a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
            long a[]=new long[n];
            for(int i=0;i<n;i++)
                a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
            int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
                a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
            long a[]=new long[n+1];
            for(int i=1;i<=n;i++)
                a[i]=nextLong();
            return a;
        }
    
    
    }
    public static void main(String args[]) throws IOException
    {
        new Thread(null, new Runnable() {
            public void run() {
                try
                {
                    solve();
                }
                catch(Exception e)
                {
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
        
    }
    static void solve() throws IOException
    {
        Scanner in=new Scanner(System.in);
        PrintWriter out=new PrintWriter(System.out);
        n=in.nextInt();
        long a[]=in.nextLongArrayOneBased(n);
        long k[]=in.nextLongArrayOneBased(n-1);
        init(k);
        SegmentTree st = new SegmentTree(a);
        int q=in.nextInt();
        while(q-->0){
            if(in.next().charAt(0)=='s'){
                out.println(st.query(in.nextInt(), in.nextInt()));
            }
            else{
                int i=in.nextInt();
                long x=in.nextInt();
                long nv=st.query(i, i)+x;
                int s=i+1,e=n,ans=i;
                while(s<=e){
                    int mid=(s+e)>>1;
                    if(st.query(mid, mid)<nv+sum(i,mid-1)){
                        ans=Math.max(ans,mid);
                        s=mid+1;
                    }
                    else
                        e=mid-1;
                }
                st.incrementRange(i, ans, nv, i);
            }
        }
        out.close();
        
    }
}
