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

public class Main implements Runnable {
	FastReader scn;
	PrintWriter out;
	String INPUT = "";

	long[][] st;
	long[] lazy;
	long inf = Long.MAX_VALUE >> 2;
	
	void solve() {
		int n = scn.nextInt();
		long[] a = new long[n + 1];
		for(int i = 1; i <= n; i++) {
			a[i] = scn.nextLong();
		}
		
		long[] t = new long[n + 1];
		for(int i = 2; i <= n; i++) {
			t[i] = scn.nextLong() + t[i - 1];
		}
		
		long[] b = new long[n + 1];
		for(int i = 1; i <= n; i++) {
			b[i] = a[i] - t[i];
		}
		
		for(int i = 1; i <= n; i++) {
			t[i] += t[i - 1];
		}
		
		st = new long[4 * n][2];
		lazy = new long[4 * n];
		Arrays.fill(lazy, inf);
		
		build(1, 1, n, b);
		
		int q = scn.nextInt();
		while(q-- > 0) {
			char ch = scn.nextChar();
			if(ch == '+') {
				int p = scn.nextInt(), x = scn.nextInt();
				long val = query(1, 1, n, p, p)[1] + x;
				int pos = getPos(val, p, n);
				update(1, 1, n, p, pos, val);
			} else {
				int l = scn.nextInt(), r = scn.nextInt();
				long tSum = t[r] - t[l - 1];
				long[] rv = query(1, 1, n, l, r);
				long bSum = rv[1];
				out.println(tSum + bSum);
			}
		}
	}
	
	int getPos(long val, int l, int r) {
		int rv = l, n = r;
		while(l <= r) {
			int m = (l + r) >> 1;
			long x = query(1, 1, n, m, m)[1];
			if(x <= val) {
				rv = m;
				l = m + 1;
			} else {
				r = m - 1;
			}
		}
		return rv;
	}
	
	long[] query(int ind, int l, int r, int si, int li) {
		if(lazy[ind] != inf) {
			st[ind][0] = lazy[ind];
			st[ind][1] = (r - l + 1) * lazy[ind];
			if(l != r) {
				lazy[2 * ind] = lazy[2 * ind + 1] = lazy[ind];
			}
			lazy[ind] = inf;
		}
		if(si > r || li < l) {
			return new long[] {Long.MIN_VALUE >> 1, 0};
		}
		if(l >= si && r <= li) {
			return st[ind];
		}
		
		int m = (l + r) >> 1;
		
		long[] x = query(2 * ind, l, m, si, li);
		long[] y = query(2 * ind + 1, m + 1, r, si, li);
		
		long[] rv = {Math.min(x[0], y[0]), x[1] + y[1]};
		return rv;
	}
	
	void update(int ind, int l, int r, int si, int li, long val) {
		if(lazy[ind] != inf) {
			st[ind][0] = lazy[ind];
			st[ind][1] = (r - l + 1) * lazy[ind];
			if(l != r) {
				lazy[2 * ind] = lazy[2 * ind + 1] = lazy[ind];
			}
			lazy[ind] = inf;
		}
		if(si > r || li < l) {
			return;
		}
		if(l >= si && r <= li) {
			st[ind][0] = val;
			st[ind][1] = (r - l + 1) * val;
			if(l != r) {
				lazy[2 * ind] = lazy[2 * ind + 1] = val;
			}
			return;
		}
		
		int m = (l + r) >> 1;
		
		update(2 * ind, l, m, si, li, val);
		update(2 * ind + 1, m + 1, r, si, li, val);
		
		st[ind][0] = Math.max(st[2 * ind][0], st[2 * ind + 1][0]);
		st[ind][1] = st[2 * ind][1] + st[2 * ind + 1][1];
	}
	
	void build(int ind, int l, int r, long[] arr) {
		if(l == r) {
			st[ind][0] = st[ind][1] = arr[l];
			return;
		}
		
		int m = (l + r) >> 1;
		
		build(2 * ind, l, m, arr);
		build(2 * ind + 1, m + 1, r, arr);
		
		st[ind][0] = Math.max(st[2 * ind][0], st[2 * ind + 1][0]);
		st[ind][1] = st[2 * ind][1] + st[2 * ind + 1][1];
	}

	public void run() {
		long time = System.currentTimeMillis();
		boolean oj = System.getProperty("ONLINE_JUDGE") != null;
		out = new PrintWriter(System.out);
		scn = new FastReader(oj);
		solve();
		out.flush();
		if (!oj) {
			System.out.println(Arrays.deepToString(new Object[] { System.currentTimeMillis() - time + " ms" }));
		}
	}

	public static void main(String[] args) {
		new Thread(null, new Main(), "Main", 1 << 26).start();
	}

	class FastReader {
		InputStream is;

		public FastReader(boolean onlineJudge) {
			is = onlineJudge ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		}

		byte[] inbuf = new byte[1024];
		public int lenbuf = 0, ptrbuf = 0;

		int readByte() {
			if (lenbuf == -1)
				throw new InputMismatchException();
			if (ptrbuf >= lenbuf) {
				ptrbuf = 0;
				try {
					lenbuf = is.read(inbuf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return -1;
			}
			return inbuf[ptrbuf++];
		}

		boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		int skip() {
			int b;
			while ((b = readByte()) != -1 && isSpaceChar(b))
				;
			return b;
		}

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

		char nextChar() {
			return (char) skip();
		}

		String next() {
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		String nextLine() {
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while ((!isSpaceChar(b) || b == ' ')) { // when nextLine, (isSpaceChar(b) && b != ' ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		char[] next(int n) {
			char[] buf = new char[n];
			int b = skip(), p = 0;
			while (p < n && !(isSpaceChar(b))) {
				buf[p++] = (char) b;
				b = readByte();
			}
			return n == p ? buf : Arrays.copyOf(buf, p);
		}

		int nextInt() {
			int num = 0, b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		long nextLong() {
			long num = 0;
			int b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		char[][] nextMatrix(int n, int m) {
			char[][] map = new char[n][];
			for (int i = 0; i < n; i++)
				map[i] = next(m);
			return map;
		}

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

		long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		int[][] next2DInt(int n, int m) {
			int[][] arr = new int[n][];
			for (int i = 0; i < n; i++) {
				arr[i] = nextIntArray(m);
			}
			return arr;
		}

		long[][] next2DLong(int n, int m) {
			long[][] arr = new long[n][];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLongArray(m);
			}
			return arr;
		}

		int[] shuffle(int[] arr) {
			Random r = new Random();
			for (int i = 1, j; i < arr.length; i++) {
				j = r.nextInt(i);
				arr[i] = arr[i] ^ arr[j];
				arr[j] = arr[i] ^ arr[j];
				arr[i] = arr[i] ^ arr[j];
			}
			return arr;
		}

		int[] uniq(int[] arr) {
			Arrays.sort(arr);
			int[] rv = new int[arr.length];
			int pos = 0;
			rv[pos++] = arr[0];
			for (int i = 1; i < arr.length; i++) {
				if (arr[i] != arr[i - 1]) {
					rv[pos++] = arr[i];
				}
			}
			return Arrays.copyOf(rv, pos);
		}

		int[] reverse(int[] arr) {
			int l = 0, r = arr.length - 1;
			while (l < r) {
				arr[l] = arr[l] ^ arr[r];
				arr[r] = arr[l] ^ arr[r];
				arr[l] = arr[l] ^ arr[r];
				l++;
				r--;
			}
			return arr;
		}
	}
}