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]. 
#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
int n, x, y, q;
char c;
long long a[N], k[N], M[N], A[N];
set<int> s;
void update(int x, long long mul, long long val) {
  while (x < n) {
    M[x] += mul;
    A[x] += val;
    x |= (x + 1);
  }
}
void add(int l, int r, long long v) {
  update(l, v, -v * (l - 1));
  update(r, -v, v * r);
}
long long query(int x) {
  int w = x;
  long long mul = 0;
  long long val = 0;
  while (x >= 0) {
    mul += M[x];
    val += A[x];
    x = (x & (x + 1)) - 1;
  }
  return mul * w + val;
}
long long get(int x) { return query(x) - query(x - 1); }
int main() {
  scanf("%d", &n);
  memset(M, 0, sizeof M);
  memset(A, 0, sizeof A);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    add(i, i, a[i]);
  }
  for (int i = 0; i + 1 < n; i++) {
    scanf("%lld", &k[i]);
    if (a[i + 1] - a[i] != k[i]) {
      s.insert(i + 1);
    }
  }
  s.insert(n);
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf(" %c %d %d", &c, &x, &y);
    x--;
    if (c == '+') {
      while (y != 0) {
        int nxt = *s.lower_bound(x + 1);
        add(x, nxt - 1, y);
        if (x != 0 && get(x) - get(x - 1) != k[x - 1]) {
          s.insert(x);
        } else if (s.count(x) != 0) {
          s.erase(x);
        }
        if (nxt >= n) {
          break;
        }
        if (get(nxt) - get(nxt - 1) >= k[nxt - 1]) {
          break;
        }
        y = k[nxt - 1] - (get(nxt) - get(nxt - 1));
        x = nxt;
      }
    } else if (c == 's') {
      y--;
      printf("%lld\n", query(y) - query(x - 1));
    }
  }
  return 0;
}
