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 = 2e5 + 100;
long long B[N], D[N], pre[N], sum[N << 2];
long long cnt = 1, ans = 0, lazy[N << 2];
pair<long long, long long> G[N];
int n;
long long f(int l, int r) {
  assert(r - l >= -1);
  assert(r < n);
  return pre[r] - pre[l - 1] - (r - l + 1) * B[l - 1];
}
void Build(int idx, int l, int r) {
  if (r - l == 1) {
    sum[idx] = D[l];
    return;
  }
  int M = l + r >> 1;
  Build(idx << 1, l, M);
  Build(idx << 1 | 1, M, r);
  sum[idx] = sum[idx << 1] + sum[idx << 1 | 1];
}
void push_down(int idx, int l, int r) {
  if (lazy[idx] != 0) {
    int u = lazy[idx], M = l + r >> 1;
    int g = G[u].first;
    long long u1 = (D[g] + (B[l - 1] - B[g - 1])) * (M - l) + f(l, M - 2);
    long long u2 = (D[g] + (B[M - 1] - B[g - 1])) * (r - M) + f(M, r - 2);
    sum[idx << 1] = u1;
    sum[idx << 1 | 1] = u2;
    lazy[idx << 1 | 1] = lazy[idx << 1] = u;
    lazy[idx] = 0;
  }
}
void Qury(int idx, int l, int r, int ql, int qr, int flag) {
  if (qr <= l || r <= ql) return;
  if (ql <= l && r <= qr) {
    if (flag == 2) {
      int g = G[cnt].first;
      sum[idx] = (D[g] + (B[l - 1] - B[g - 1])) * (r - l) + f(l, r - 2);
      lazy[idx] = cnt;
    } else if (flag == 1)
      D[l] = sum[idx];
    else
      ans += sum[idx];
    return;
  }
  push_down(idx, l, r);
  int M = l + r >> 1;
  Qury(idx << 1, l, M, ql, qr, flag);
  Qury(idx << 1 | 1, M, r, ql, qr, flag);
  sum[idx] = sum[idx << 1] + sum[idx << 1 | 1];
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lld", &D[i + 1]);
  for (int i = 0; i < n - 1; i++) scanf("%lld", &B[i + 1]);
  long long sum1 = 0, g = 0;
  for (int i = 1; i < n; i++) {
    g += B[i];
    sum1 += g;
    pre[i] = sum1;
  }
  for (int i = 1; i < n; i++) B[i] += B[i - 1];
  int q;
  scanf("%d ", &q);
  Build(1, 1, n + 1);
  while (q--) {
    char t;
    int a, b;
    scanf("%c %d %d ", &t, &a, &b);
    G[cnt] = {a, b};
    if (t == '+') {
      Qury(1, 1, n + 1, a, a + 1, 1);
      int l = a + 1, r = n + 1;
      while (l < r) {
        int M = l + r >> 1;
        Qury(1, 1, n + 1, M, M + 1, 1);
        long long u = D[a] + B[M - 1] - B[a - 1] + G[cnt].second;
        if (u > D[M])
          l = M + 1;
        else
          r = M;
      }
      D[a] += G[cnt].second;
      Qury(1, 1, n + 1, a, r, 2);
    } else {
      ans = 0;
      Qury(1, 1, n + 1, a, b + 1, 0);
      cout << ans << '\n';
    }
    cnt++;
  }
}
