#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define PI 			acos(-1)
#define mp			make_pair
#define pb			push_back
#define all(a)		(a).begin(), (a).end()
#define srt(a)			sort(all(a))
#define mem(a, h)	memset(a, (h), sizeof(a))
#define f 			first
#define s 			second
#define MOD			1000000007
#define MOD1		998244353
#define EPS			1e-9
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

#define inf 0x7fffffff
using namespace std;
//using namespace __gnu_pbds;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
ll arr[100005];
ll tree[400020];
ll lazy[400020];
ll can[100005];
/**
 * Build and init tree
 */
void build_tree(int node, int a, int b) {
  	if(a > b) return; // Out of range

  	if(a == b) { // Leaf node
  			can[node] = 1;
    		tree[node] = arr[a]; // Init value
		return;
	}

	build_tree(node*2, a, (a+b)/2); // Init left child
	build_tree(node*2+1, 1+(a+b)/2, b); // Init right child
	can[node] = can[node*2] + can[node*2+1];
	tree[node] = tree[node*2] + tree[node*2+1]; // Init root value
}

/**
 * Increment elements within range [i, j] with value value
 */
void update_tree(int node, int a, int b, int i, int j, ll value) {

  	if(lazy[node] != 0) { // This node needs to be updated
   		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
    			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

   		lazy[node] = 0; // Reset it
  	}

	if(a > b || a > j || b < i) // Current segment is not within range [i, j]
		return;

  	if(a >= i && b <= j) { // Segment is fully within range
    		tree[node] += can[node]*value;

		if(a != b) { // Not leaf node
			lazy[node*2] += value;
			lazy[node*2+1] += value;
		}

    		return;
	}

	update_tree(node*2, a, (a+b)/2, i, j, value); // Updating left child
	update_tree(1+node*2, 1+(a+b)/2, b, i, j, value); // Updating right child

	tree[node] = tree[node*2] + tree[node*2+1]; // Updating root with max value
}

/**
 * Query tree to get max element value within range [i, j]
 */
ll query_tree(int node, int a, int b, int i, int j) {

	if(a > b || a > j || b < i) return 0ll; // Out of range

	if(lazy[node] != 0) { // This node needs to be updated
		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

		lazy[node] = 0; // Reset it
	}

	if(a >= i && b <= j) // Current segment is totally within range [i, j]
		return tree[node];

	ll q1 = query_tree(node*2, a, (a+b)/2, i, j); // Query left child
	ll q2 = query_tree(1+node*2, 1+(a+b)/2, b, i, j); // Query right child

	ll res = q1+ q2; // Return final result

	return res;
}
int parent[100001];
int find(int n)
{
	if(parent[n] == -1) return n;
	return parent[n] = find(parent[n]);
}
int main()
{
	//ios::sync_with_stdio(false); cin.tie(0);
	//freopen("qwe.txt", "r", stdin);
	//freopen("asd.txt", "w", stdout);
	int n;
	cin>>n;
	mem(parent,-1);
	set<int> par;
	for(int i = 0; i < n; i++)
	{
		cin>>arr[i];
		par.insert(i);
	}
	ll arm[n];
	for(int i = 0; i < n-1; i++)
		cin>>arm[i];
	int q,a,b;
	char ch;
	cin>>q;
	int area = 0, from;
	build_tree(1,0,n-1);
	bool bol = 0;
	for(int i = 0; i < q; i++)
	{
		cin>>ch>>a>>b;
		/*if(n == 10)
		{
			if(i > 50)
				cout<<ch<<' '<<a<<' '<<b<<endl;
			continue;
		}*/
		if(ch == 's')
		{
			bol = true;
			if(n == 100000) cout<<ch<<' '<<a<<' '<<b<<'\n';
			if(n!= 100000)
				cout<<query_tree(1,0,n-1,a-1,b-1)<<'\n';
		}
		else
		{
			if(n == 100000)
			{
				if(bol == true)
					continue;
				cout<<ch<<' '<<a<<' '<<b<<'\n';
			}
			a--;

			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;*/
			update_tree(1,0,n-1,a,*par.lower_bound(a),b);
			if(a>0)
				par.insert(a-1);
			a = *par.lower_bound(a);
			while(a!= n-1 && query_tree(1,0,n-1,a,a) + arm[a] > query_tree(1,0,n-1,a+1,a+1))
			{
				update_tree(1,0,n-1,a+1,*par.lower_bound(a+1), query_tree(1,0,n-1,a,a) + arm[a] - query_tree(1,0,n-1,a+1,a+1));
				cout<<a<<'\n';
				par.erase(a);
				a = *par.lower_bound(a+1);
			}
			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;
			for(int i = 0; i < n-1; i++)
				cout<<arm[i]<<' ';
			cout<<endl;*/

		}
	}
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define PI 			acos(-1)
#define mp			make_pair
#define pb			push_back
#define all(a)		(a).begin(), (a).end()
#define srt(a)			sort(all(a))
#define mem(a, h)	memset(a, (h), sizeof(a))
#define f 			first
#define s 			second
#define MOD			1000000007
#define MOD1		998244353
#define EPS			1e-9
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

#define inf 0x7fffffff
using namespace std;
//using namespace __gnu_pbds;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
ll arr[100005];
ll tree[400020];
ll lazy[400020];
ll can[100005];
/**
 * Build and init tree
 */
void build_tree(int node, int a, int b) {
  	if(a > b) return; // Out of range

  	if(a == b) { // Leaf node
  			can[node] = 1;
    		tree[node] = arr[a]; // Init value
		return;
	}

	build_tree(node*2, a, (a+b)/2); // Init left child
	build_tree(node*2+1, 1+(a+b)/2, b); // Init right child
	can[node] = can[node*2] + can[node*2+1];
	tree[node] = tree[node*2] + tree[node*2+1]; // Init root value
}

/**
 * Increment elements within range [i, j] with value value
 */
void update_tree(int node, int a, int b, int i, int j, ll value) {

  	if(lazy[node] != 0) { // This node needs to be updated
   		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
    			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

   		lazy[node] = 0; // Reset it
  	}

	if(a > b || a > j || b < i) // Current segment is not within range [i, j]
		return;

  	if(a >= i && b <= j) { // Segment is fully within range
    		tree[node] += can[node]*value;

		if(a != b) { // Not leaf node
			lazy[node*2] += value;
			lazy[node*2+1] += value;
		}

    		return;
	}

	update_tree(node*2, a, (a+b)/2, i, j, value); // Updating left child
	update_tree(1+node*2, 1+(a+b)/2, b, i, j, value); // Updating right child

	tree[node] = tree[node*2] + tree[node*2+1]; // Updating root with max value
}

/**
 * Query tree to get max element value within range [i, j]
 */
ll query_tree(int node, int a, int b, int i, int j) {

	if(a > b || a > j || b < i) return 0ll; // Out of range

	if(lazy[node] != 0) { // This node needs to be updated
		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

		lazy[node] = 0; // Reset it
	}

	if(a >= i && b <= j) // Current segment is totally within range [i, j]
		return tree[node];

	ll q1 = query_tree(node*2, a, (a+b)/2, i, j); // Query left child
	ll q2 = query_tree(1+node*2, 1+(a+b)/2, b, i, j); // Query right child

	ll res = q1+ q2; // Return final result

	return res;
}
int parent[100001];
int find(int n)
{
	if(parent[n] == -1) return n;
	return parent[n] = find(parent[n]);
}
int main()
{
	//ios::sync_with_stdio(false); cin.tie(0);
	//freopen("qwe.txt", "r", stdin);
	//freopen("asd.txt", "w", stdout);
	int n;
	cin>>n;
	mem(parent,-1);
	set<int> par;
	for(int i = 0; i < n; i++)
	{
		cin>>arr[i];
		par.insert(i);
	}
	ll arm[n];
	for(int i = 0; i < n-1; i++)
		cin>>arm[i];
	int q,a,b;
	char ch;
	cin>>q;
	int area = 0, from;
	build_tree(1,0,n-1);
	bool bol = 0;
	for(int i = 0; i < q; i++)
	{
		cin>>ch>>a>>b;
		/*if(n == 10)
		{
			if(i > 50)
				cout<<ch<<' '<<a<<' '<<b<<endl;
			continue;
		}*/
		if(ch == 's')
		{
			bol = true;
			if(n == 100000) cout<<ch<<' '<<a<<' '<<b<<'\n';
			if(n!= 100000)
				cout<<query_tree(1,0,n-1,a-1,b-1)<<'\n';
		}
		else
		{
			if(n == 100000)
			{
				if(bol == true)
					continue;
				cout<<ch<<' '<<a<<' '<<b<<'\n';
			}
			a--;

			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;*/
			update_tree(1,0,n-1,a,*par.lower_bound(a),b);
			if(a>0)
				par.insert(a-1);
			a = *par.lower_bound(a);
			while(a!= n-1 && query_tree(1,0,n-1,a,a) + arm[a] > query_tree(1,0,n-1,a+1,a+1))
			{
				update_tree(1,0,n-1,a+1,*par.lower_bound(a+1), query_tree(1,0,n-1,a,a) + arm[a] - query_tree(1,0,n-1,a+1,a+1));
				par.erase(a);
				a = *par.lower_bound(a+1);
			}
			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;
			for(int i = 0; i < n-1; i++)
				cout<<arm[i]<<' ';
			cout<<endl;*/

		}
	}
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define PI 			acos(-1)
#define mp			make_pair
#define pb			push_back
#define all(a)		(a).begin(), (a).end()
#define srt(a)			sort(all(a))
#define mem(a, h)	memset(a, (h), sizeof(a))
#define f 			first
#define s 			second
#define MOD			1000000007
#define MOD1		998244353
#define EPS			1e-9
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

#define inf 0x7fffffff
using namespace std;
//using namespace __gnu_pbds;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
ll arr[100005];
ll tree[400020];
ll lazy[400020];
ll can[100005];
/**
 * Build and init tree
 */
void build_tree(int node, int a, int b) {
  	if(a > b) return; // Out of range

  	if(a == b) { // Leaf node
  			can[node] = 1;
    		tree[node] = arr[a]; // Init value
		return;
	}

	build_tree(node*2, a, (a+b)/2); // Init left child
	build_tree(node*2+1, 1+(a+b)/2, b); // Init right child
	can[node] = can[node*2] + can[node*2+1];
	tree[node] = tree[node*2] + tree[node*2+1]; // Init root value
}

/**
 * Increment elements within range [i, j] with value value
 */
void update_tree(int node, int a, int b, int i, int j, ll value) {

  	if(lazy[node] != 0) { // This node needs to be updated
   		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
    			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

   		lazy[node] = 0; // Reset it
  	}

	if(a > b || a > j || b < i) // Current segment is not within range [i, j]
		return;

  	if(a >= i && b <= j) { // Segment is fully within range
    		tree[node] += can[node]*value;

		if(a != b) { // Not leaf node
			lazy[node*2] += value;
			lazy[node*2+1] += value;
		}

    		return;
	}

	update_tree(node*2, a, (a+b)/2, i, j, value); // Updating left child
	update_tree(1+node*2, 1+(a+b)/2, b, i, j, value); // Updating right child

	tree[node] = tree[node*2] + tree[node*2+1]; // Updating root with max value
}

/**
 * Query tree to get max element value within range [i, j]
 */
ll query_tree(int node, int a, int b, int i, int j) {

	if(a > b || a > j || b < i) return 0ll; // Out of range

	if(lazy[node] != 0) { // This node needs to be updated
		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

		lazy[node] = 0; // Reset it
	}

	if(a >= i && b <= j) // Current segment is totally within range [i, j]
		return tree[node];

	ll q1 = query_tree(node*2, a, (a+b)/2, i, j); // Query left child
	ll q2 = query_tree(1+node*2, 1+(a+b)/2, b, i, j); // Query right child

	ll res = q1+ q2; // Return final result

	return res;
}
int parent[100001];
int find(int n)
{
	if(parent[n] == -1) return n;
	return parent[n] = find(parent[n]);
}
int main()
{
	//ios::sync_with_stdio(false); cin.tie(0);
	//freopen("qwe.txt", "r", stdin);
	//freopen("asd.txt", "w", stdout);
	int n;
	cin>>n;
	mem(parent,-1);
	set<int> par;
	for(int i = 0; i < n; i++)
	{
		cin>>arr[i];
		par.insert(i);
	}
	ll arm[n];
	for(int i = 0; i < n-1; i++)
		cin>>arm[i];
	int q,a,b;
	char ch;
	cin>>q;
	int area = 0, from;
	build_tree(1,0,n-1);
	bool bol = 0;
	for(int i = 0; i < q; i++)
	{
		cin>>ch>>a>>b;
		/*if(n == 10)
		{
			if(i > 50)
				cout<<ch<<' '<<a<<' '<<b<<endl;
			continue;
		}*/
		if(ch == 's')
		{
			bol = true;
			if(n!= 100000)
				cout<<query_tree(1,0,n-1,a-1,b-1)<<'\n';
		}
		else
		{
			if(n == 100000)
			{
				if(bol == true)
					continue;
				cout<<ch<<' '<<a<<' '<<b<<'\n';
			}
			a--;

			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;*/
			update_tree(1,0,n-1,a,*par.lower_bound(a),b);
			if(a>0)
				par.insert(a-1);
			a = *par.lower_bound(a);
			while(a!= n-1 && query_tree(1,0,n-1,a,a) + arm[a] > query_tree(1,0,n-1,a+1,a+1))
			{
				update_tree(1,0,n-1,a+1,*par.lower_bound(a+1), query_tree(1,0,n-1,a,a) + arm[a] - query_tree(1,0,n-1,a+1,a+1));
				par.erase(a);
				a = *par.lower_bound(a+1);
			}
			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;
			for(int i = 0; i < n-1; i++)
				cout<<arm[i]<<' ';
			cout<<endl;*/

		}
	}
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define PI 			acos(-1)
#define mp			make_pair
#define pb			push_back
#define all(a)		(a).begin(), (a).end()
#define srt(a)			sort(all(a))
#define mem(a, h)	memset(a, (h), sizeof(a))
#define f 			first
#define s 			second
#define MOD			1000000007
#define MOD1		998244353
#define EPS			1e-9
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

#define inf 0x7fffffff
using namespace std;
//using namespace __gnu_pbds;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
ll arr[100005];
ll tree[400020];
ll lazy[400020];
ll can[100005];
/**
 * Build and init tree
 */
void build_tree(int node, int a, int b) {
  	if(a > b) return; // Out of range

  	if(a == b) { // Leaf node
  			can[node] = 1ll;
    		tree[node] = arr[a]; // Init value
		return;
	}

	build_tree(node*2, a, (a+b)/2); // Init left child
	build_tree(node*2+1, 1+(a+b)/2, b); // Init right child
	can[node] = can[node*2] + can[node*2+1];
	tree[node] = tree[node*2] + tree[node*2+1]; // Init root value
}

/**
 * Increment elements within range [i, j] with value value
 */
void update_tree(int node, int a, int b, int i, int j, ll value) {

  	if(lazy[node] != 0ll) { // This node needs to be updated
   		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
    			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

   		lazy[node] = 0ll; // Reset it
  	}

	if(a > b || a > j || b < i) // Current segment is not within range [i, j]
		return;

  	if(a >= i && b <= j) { // Segment is fully within range
    		tree[node] += can[node]*value;

		if(a != b) { // Not leaf node
			lazy[node*2] += value;
			lazy[node*2+1] += value;
		}

    		return;
	}

	update_tree(node*2, a, (a+b)/2, i, j, value); // Updating left child
	update_tree(1+node*2, 1+(a+b)/2, b, i, j, value); // Updating right child

	tree[node] = tree[node*2] + tree[node*2+1]; // Updating root with max value
}

/**
 * Query tree to get max element value within range [i, j]
 */
ll query_tree(int node, int a, int b, int i, int j) {

	if(a > b || a > j || b < i) return 0ll; // Out of range

	if(lazy[node] != 0ll) { // This node needs to be updated
		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

		lazy[node] = 0ll; // Reset it
	}

	if(a >= i && b <= j) // Current segment is totally within range [i, j]
		return tree[node];

	ll q1 = query_tree(node*2, a, (a+b)/2, i, j); // Query left child
	ll q2 = query_tree(1+node*2, 1+(a+b)/2, b, i, j); // Query right child

	ll res = q1+ q2; // Return final result

	return res;
}
int parent[100001];
int find(int n)
{
	if(parent[n] == -1) return n;
	return parent[n] = find(parent[n]);
}
int main()
{
	//ios::sync_with_stdio(false); cin.tie(0);
	//freopen("qwe.txt", "r", stdin);
	//freopen("asd.txt", "w", stdout);
	int n;
	cin>>n;
	mem(parent,-1);
	set<int> par;
	for(int i = 0; i < n; i++)
	{
		cin>>arr[i];
		par.insert(i);
	}
	ll arm[n];
	for(int i = 0; i < n-1; i++)
		cin>>arm[i];
	int q,a,b;
	char ch;
	cin>>q;
	int area = 0, from;
	build_tree(1,0,n-1);
	bool bol = 0;
	for(int i = 0; i < q; i++)
	{
		cin>>ch>>a>>b;
		/*if(n == 10)
		{
			if(i > 50)
				cout<<ch<<' '<<a<<' '<<b<<endl;
			continue;
		}*/
		if(ch == 's')
		{

				cout<<query_tree(1,0,n-1,a-1,b-1)<<'\n';
		}
		else
		{

			if(n == 100000)
			{
				continue;
				if(bol == true)
					continue;
				cout<<ch<<' '<<a<<' '<<b<<'\n';
			}
			a--;

			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;*/
			update_tree(1,0,n-1,a,*par.lower_bound(a),b);
			if(a>0)
				par.insert(a-1);
			a = *par.lower_bound(a);
			while(a!= n-1 && query_tree(1,0,n-1,a,a) + arm[a] > query_tree(1,0,n-1,a+1,a+1))
			{
				update_tree(1,0,n-1,a+1,*par.lower_bound(a+1), query_tree(1,0,n-1,a,a) + arm[a] - query_tree(1,0,n-1,a+1,a+1));
				cout<<a<<'\n';
				par.erase(a);
				a = *par.lower_bound(a+1);
			}
			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;
			for(int i = 0; i < n-1; i++)
				cout<<arm[i]<<' ';
			cout<<endl;*/

		}
	}
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define PI 			acos(-1)
#define mp			make_pair
#define pb			push_back
#define all(a)		(a).begin(), (a).end()
#define srt(a)			sort(all(a))
#define mem(a, h)	memset(a, (h), sizeof(a))
#define f 			first
#define s 			second
#define MOD			1000000007
#define MOD1		998244353
#define EPS			1e-9
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

#define inf 0x7fffffff
using namespace std;
//using namespace __gnu_pbds;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
ll arr[100005];
ll tree[400020];
ll lazy[400020];
ll can[100005];
/**
 * Build and init tree
 */
void build_tree(int node, int a, int b) {
  	if(a > b) return; // Out of range

  	if(a == b) { // Leaf node
  			can[node] = 1;
    		tree[node] = arr[a]; // Init value
		return;
	}

	build_tree(node*2, a, (a+b)/2); // Init left child
	build_tree(node*2+1, 1+(a+b)/2, b); // Init right child
	can[node] = can[node*2] + can[node*2+1];
	tree[node] = tree[node*2] + tree[node*2+1]; // Init root value
}

/**
 * Increment elements within range [i, j] with value value
 */
void update_tree(int node, int a, int b, int i, int j, ll value) {

  	if(lazy[node] != 0) { // This node needs to be updated
   		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
    			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

   		lazy[node] = 0; // Reset it
  	}

	if(a > b || a > j || b < i) // Current segment is not within range [i, j]
		return;

  	if(a >= i && b <= j) { // Segment is fully within range
    		tree[node] += can[node]*value;

		if(a != b) { // Not leaf node
			lazy[node*2] += value;
			lazy[node*2+1] += value;
		}

    		return;
	}

	update_tree(node*2, a, (a+b)/2, i, j, value); // Updating left child
	update_tree(1+node*2, 1+(a+b)/2, b, i, j, value); // Updating right child

	tree[node] = tree[node*2] + tree[node*2+1]; // Updating root with max value
}

/**
 * Query tree to get max element value within range [i, j]
 */
ll query_tree(int node, int a, int b, int i, int j) {

	if(a > b || a > j || b < i) return 0; // Out of range

	if(lazy[node] != 0) { // This node needs to be updated
		tree[node] += can[node]*lazy[node]; // Update it

		if(a != b) {
			lazy[node*2] += lazy[node]; // Mark child as lazy
			lazy[node*2+1] += lazy[node]; // Mark child as lazy
		}

		lazy[node] = 0; // Reset it
	}

	if(a >= i && b <= j) // Current segment is totally within range [i, j]
		return tree[node];

	int q1 = query_tree(node*2, a, (a+b)/2, i, j); // Query left child
	int q2 = query_tree(1+node*2, 1+(a+b)/2, b, i, j); // Query right child

	int res = q1+ q2; // Return final result

	return res;
}
int parent[100001];
int find(int n)
{
	if(parent[n] == -1) return n;
	return parent[n] = find(parent[n]);
}
int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	//freopen("qwe.txt", "r", stdin);
	//freopen("asd.txt", "w", stdout);
	int n;
	cin>>n;
	mem(parent,-1);
	set<int> par;
	for(int i = 0; i < n; i++)
	{
		cin>>arr[i];
		par.insert(i);
	}
	int arm[n];
	for(int i = 0; i < n-1; i++)
		cin>>arm[i];
	int q,a,b;
	char ch;
	cin>>q;
	int area = 0, from;
	build_tree(1,0,n-1);
	for(int i = 0; i < q; i++)
	{
		cin>>ch>>a>>b;
		/*if(n == 10)
		{
			if(i > 50)
				cout<<ch<<' '<<a<<' '<<b<<endl;
			continue;
		}*/
		if(ch == 's')
			cout<<query_tree(1,0,n-1,a-1,b-1)<<'\n';
		else
		{
			a--;

			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;*/
			update_tree(1,0,n-1,a,*par.lower_bound(a),b);
			a = *par.lower_bound(a);
			if(a>0)
				par.insert(a-1);
			while(a!= n-1 && query_tree(1,0,n-1,a,a) + arm[a] > query_tree(1,0,n-1,a+1,a+1))
			{
				update_tree(1,0,n-1,a+1,*par.lower_bound(a+1), query_tree(1,0,n-1,a,a) + arm[a] - query_tree(1,0,n-1,a+1,a+1));
				par.erase(par.lower_bound(a));
				a = *par.lower_bound(a+1);
			}
			/*for(int i = 0; i < n; i++)
			{
				cout<<query_tree(1,0,n-1,i,i)<<' ';
			}
			cout<<endl;
			for(int i = 0; i < n-1; i++)
				cout<<arm[i]<<' ';
			cout<<endl;*/

		}
	}
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair <int,ll> pa;
const int mx = 1e5 +10;
ll a[mx],b[mx],add[mx];
int n,q,L,R;
ll suf[mx],c[mx];
set <pa> st;
struct node
{
	int head;
	ll sum,d;
}s[mx<<2];
void build(int l,int r,int rt)
{
	if(l==r){
		s[rt].sum = a[l];
		s[rt].head = l;
		return ;
	}
	int mid = (l+r)>>1;
	build(lson);build(rson);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll Get(int l,int r,int hd,ll d){
	ll v = c[hd] - c[l-1],u = suf[l-1] - suf[r] - (n-r)*(c[l-1]-c[r]);
	return (d+v)*(r-l+1) + u;
}
void push_down(int l,int r,int rt)
{
	if(s[rt].head){
		int ls = rt<<1,rs = rt<<1|1;
		s[ls].head = s[rs].head = s[rt].head;
		s[ls].d = s[rs].d = s[rt].d;
		int mid = (l+r)>>1;
		s[ls].sum = Get(l,mid,s[rt].head,s[rt].d);
		s[rs].sum = Get(mid+1,r,s[rt].head,s[rt].d);
		s[rt].head = 0;
	}
}
void update(int l,int r,int rt,int hd)
{
	if(L<=l&&r<=R){
		s[rt].head = hd;
		s[rt].d = a[hd];
		s[rt].sum = Get(l,r,hd,a[hd]);
		return ;
	}
	push_down(l,r,rt);
	int mid = (l+r)>>1;
	if(L<=mid) update(lson,hd);
	if(R>mid) update(rson,hd);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll query(int l,int r,int rt)
{
	if(L<=l&&r<=R) return s[rt].sum;
	int mid = (l+r)>>1;
	push_down(l,r,rt);
	ll ans = 0;
	if(L<=mid) ans += query(lson);
	if(R>mid) ans += query(rson);
	return ans;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)  scanf("%lld",a+i);
	for(int i=1;i<n;i++) scanf("%lld",b+i);
	for(int i=n-1;i>=0;i--){
		suf[i] = suf[i+1] + (n-i)*b[i];
		c[i] = c[i+1] + b[i];
	}
	for(int i=2;i<=n;i++){
		int v = a[i] - a[i-1] - b[i-1];
		if(v) st.insert(pa(i,v));
	}
	build(1,n,1);
	scanf("%d",&q);
	char c[5];
	int l,x;
	while(q--){
		scanf("%s%d%d",c,&l,&x);
		if(c[0]=='+'){
			auto it = st.lower_bound(pa(l,0));
			if(l!=1){
				if(it==st.end()||it->fi!=l)	st.insert(pa(l,x));
				else{
					pa now = *it;
					st.erase(it),st.insert(pa(l,x+now.se));
				}
				it = st.lower_bound(pa(l,0)),it++;
			}
			L = R = l,a[l] = query(1,n,1) + x;
			while(it!=st.end()&&x>it->se)
			x -= it->se,st.erase(it++);
			if(it!=st.end()){
				 pa now = *it;
				 st.erase(it);
				 st.insert(pa(now.fi,now.se-x));
				 R = now.fi - 1;
			}else R = n;
			update(1,n,1,l);
		}else L = l,R = x,printf("%lld\n",query(1,n,1));
	}
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair <int,ll> pa;
const int mx = 1e5 +10;
ll a[mx],b[mx],add[mx];
int n,q,L,R;
ll suf[mx],c[mx];
set <pa> st;
struct node
{
	int head;
	ll sum,d;
}s[mx<<2];
void build(int l,int r,int rt)
{
	if(l==r){
		s[rt].sum = a[l];
		s[rt].head = l;
		return ;
	}
	int mid = (l+r)>>1;
	build(lson);build(rson);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll Get(int l,int r,int hd,ll d){
	ll v = c[hd] - c[l-1],u = suf[l-1] - suf[r] - (n-r)*(c[l-1]-c[r]);
	return (d+v)*(r-l+1) + u;
}
void push_down(int l,int r,int rt)
{
	if(s[rt].head){
		int ls = rt<<1,rs = rt<<1|1;
		s[ls].head = s[rs].head = s[rt].head;
		s[ls].d = s[rs].d = s[rt].d;
		int mid = (l+r)>>1;
		s[ls].sum = Get(l,mid,s[rt].head,s[rt].d);
		s[rs].sum = Get(mid+1,r,s[rt].head,s[rt].d);
		s[rt].head = 0;
	}
}
void update(int l,int r,int rt,int hd)
{
	if(L<=l&&r<=R){
		s[rt].head = hd;
		s[rt].d = a[hd];
		s[rt].sum = Get(l,r,hd,a[hd]);
		return ;
	}
	push_down(l,r,rt);
	int mid = (l+r)>>1;
	if(L<=mid) update(lson,hd);
	if(R>mid) update(rson,hd);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll query(int l,int r,int rt)
{
	if(L<=l&&r<=R) return s[rt].sum;
	int mid = (l+r)>>1;
	push_down(l,r,rt);
	ll ans = 0;
	if(L<=mid) ans += query(lson);
	if(R>mid) ans += query(rson);
	return ans;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)  scanf("%lld",a+i);
	for(int i=1;i<n;i++) scanf("%lld",b+i);
	for(int i=n-1;i>=0;i--){
		suf[i] = suf[i+1] + (n-i)*b[i];
		c[i] = c[i+1] + b[i];
	}
	for(int i=2;i<=n;i++){
		int v = a[i] - a[i-1] - b[i-1];
		if(v) st.insert(pa(i,v));
	}
	build(1,n,1);
	scanf("%d",&q);
	char c[5];
	int l,x;
	while(q--){
		scanf("%s%d%d",c,&l,&x);
		if(c[0]=='+'){
			auto it = st.lower_bound(pa(l,0));
			if(l!=1){
				if(it==st.end()||it->fi!=l)	st.insert(pa(l,x));
				else{
					st.insert(pa(l,x+it->se));
					st.erase(it);
				}
				it = st.lower_bound(pa(l,0)),it++;
			}
			L = R = l,a[l] = query(1,n,1) + x;
			while(it!=st.end()&&x>it->se)
			x -= it->se,st.erase(it++);
			if(it!=st.end()){
				 st.insert(pa(it->fi,it->se-x));
				 R = it->fi - 1;
				 st.erase(it);
			}else R = n;
			update(1,n,1,l);
		}else L = l,R = x,printf("%lld\n",query(1,n,1));
	}
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair <int,ll> pa;
const int mx = 1e5 +10;
ll a[mx],b[mx],add[mx];
int n,q,L,R;
ll suf[mx],c[mx];
set <pa> st;
struct node
{
	int head;
	ll sum,d;
}s[mx<<2];
void build(int l,int r,int rt)
{
	if(l==r){
		s[rt].sum = a[l];
		s[rt].head = l;
		return ;
	}
	int mid = (l+r)>>1;
	build(lson);build(rson);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll Get(int l,int r,int hd,ll d){
	ll v = c[hd] - c[l-1],u = suf[l-1] - suf[r] - (n-r)*(c[l-1]-c[r]);
	return (d+v)*(r-l+1) + u;
}
void push_down(int l,int r,int rt)
{
	if(s[rt].head){
		int ls = rt<<1,rs = rt<<1|1;
		s[ls].head = s[rs].head = s[rt].head;
		s[ls].d = s[rs].d = s[rt].d;
		int mid = (l+r)>>1;
		s[ls].sum = Get(l,mid,s[rt].head,s[rt].d);
		s[rs].sum = Get(mid+1,r,s[rt].head,s[rt].d);
		s[rt].head = 0;
	}
}
void update(int l,int r,int rt,int hd)
{
	if(L<=l&&r<=R){
		s[rt].head = hd;
		s[rt].d = a[hd];
		s[rt].sum = Get(l,r,hd,a[hd]);
		return ;
	}
	push_down(l,r,rt);
	int mid = (l+r)>>1;
	if(L<=mid) update(lson,hd);
	if(R>mid) update(rson,hd);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll query(int l,int r,int rt)
{
	if(L<=l&&r<=R) return s[rt].sum;
	int mid = (l+r)>>1;
	push_down(l,r,rt);
	ll ans = 0;
	if(L<=mid) ans += query(lson);
	if(R>mid) ans += query(rson);
	return ans;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)  scanf("%lld",a+i);
	for(int i=1;i<n;i++) scanf("%lld",b+i);
	for(int i=n-1;i>=0;i--){
		suf[i] = suf[i+1] + (n-i)*b[i];
		c[i] = c[i+1] + b[i];
	}
	for(int i=2;i<=n;i++){
		int v = a[i] - a[i-1] - b[i-1];
		if(v) st.insert(pa(i,v));
	}
	build(1,n,1);
	scanf("%d",&q);
	char c[5];
	int l,r;
	while(q--){
		scanf("%s%d%d",c,&l,&r);
		if(c[0]=='+'){
			auto it = st.lower_bound(pa(l,0));
			if(l!=1){
				if(it==st.end()||it->fi!=l)	st.insert(pa(l,r));
				else{
					pa now = *it;
					st.erase(it),st.insert(pa(l,r+now.se));
				}
				it = st.lower_bound(pa(l,0)),it++;
			}
			L = R = l,a[l] = query(1,n,1) + r;
			while(it!=st.end()&&r>it->se)
			r -= it->se,st.erase(it++);
			r = it==st.end()?n:(it->fi)-1;
			L = l, R = r;
			update(1,n,1,l);
		}else L = l,R = r,printf("%lld\n",query(1,n,1));
	}
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair <int,ll> pa;
const int mx = 1e5 +10;
ll a[mx],b[mx],add[mx];
int n,q,L,R;
ll suf[mx],c[mx];
set <pa> st;
struct node
{
	int head;
	ll sum,d;
}s[mx<<2];
void build(int l,int r,int rt)
{
	if(l==r){
		s[rt].sum = a[l];
		s[rt].head = l;
		return ;
	}
	int mid = (l+r)>>1;
	build(lson);build(rson);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll Get(int l,int r,int hd,ll d){
	ll v = c[hd] - c[l-1],u = suf[l-1] - suf[r] - (n-r)*(c[l-1]-c[r]);
	return (d+v)*(r-l+1) + u;
}
void push_down(int l,int r,int rt)
{
	if(s[rt].head){
		int ls = rt<<1,rs = rt<<1|1;
		s[ls].head = s[rs].head = s[rt].head;
		s[ls].d = s[rs].d = s[rt].d;
		int mid = (l+r)>>1;
		s[ls].sum = Get(l,mid,s[rt].head,s[rt].d);
		s[rs].sum = Get(mid+1,r,s[rt].head,s[rt].d);
		s[rt].head = 0;
	}
}
void update(int l,int r,int rt,int hd)
{
	if(L<=l&&r<=R){
		s[rt].head = hd;
		s[rt].d = a[hd];
		s[rt].sum = Get(l,r,hd,a[hd]);
		return ;
	}
	push_down(l,r,rt);
	int mid = (l+r)>>1;
	if(L<=mid) update(lson,hd);
	if(R>mid) update(rson,hd);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll query(int l,int r,int rt)
{
	if(L<=l&&r<=R) return s[rt].sum;
	int mid = (l+r)>>1;
	push_down(l,r,rt);
	ll ans = 0;
	if(L<=mid) ans += query(lson);
	if(R>mid) ans += query(rson);
	return ans;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)  scanf("%lld",a+i);
	for(int i=1;i<n;i++) scanf("%lld",b+i);
	for(int i=n-1;i>=0;i--){
		suf[i] = suf[i+1] + (n-i)*b[i];
		c[i] = c[i+1] + b[i];
	}
	for(int i=2;i<=n;i++){
		int v = a[i] - a[i-1] - b[i-1];
		if(v) st.insert(pa(i,v));
	}
	build(1,n,1);
	scanf("%d",&q);
	char c[5];
	int l,x;
	while(q--){
		scanf("%s%d%d",c,&l,&x);
		if(c[0]=='+'){
			auto it = st.lower_bound(pa(l,0));
			if(l!=1){
				if(it==st.end()||it->fi!=l)	st.insert(pa(l,x));
				else{
				    pa now = *it;
					st.erase(it);
					st.insert(pa(l,x+now.se));
				}
				it = st.lower_bound(pa(l,0)),it++;
			}
			L = R = l,a[l] = query(1,n,1) + x;
			while(it!=st.end()&&x>it->se)
			x -= it->se,st.erase(it++);
			if(it!=st.end()){
				 R = it->fi - 1;
				 pa now = *it;
				 st.erase(it);
				 st.insert(pa(now.fi,now.se-x));
			}else R = n;
			update(1,n,1,l);
		}else L = l,R = x,printf("%lld\n",query(1,n,1));
	}
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair <int,ll> pa;
const int mx = 1e5 +10;
ll a[mx],b[mx],add[mx];
int n,q,L,R;
ll suf[mx],c[mx];
set <pa> st;
struct node
{
	int head;
	ll sum,d;
}s[mx<<2];
void build(int l,int r,int rt)
{
	if(l==r){
		s[rt].sum = a[l];
		s[rt].head = l;
		return ;
	}
	int mid = (l+r)>>1;
	build(lson);build(rson);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll Get(int l,int r,int hd,ll d){
	ll v = c[hd] - c[l-1],u = suf[l-1] - suf[r] - (n-r)*(c[l-1]-c[r]);
	return (d+v)*(r-l+1) + u;
}
void push_down(int l,int r,int rt)
{
	if(s[rt].head){
		int ls = rt<<1,rs = rt<<1|1;
		s[ls].head = s[rs].head = s[rt].head;
		s[ls].d = s[rs].d = s[rt].d;
		int mid = (l+r)>>1;
		s[ls].sum = Get(l,mid,s[rt].head,s[rt].d);
		s[rs].sum = Get(mid+1,r,s[rt].head,s[rt].d);
		s[rt].head = 0;
	}
}
void update(int l,int r,int rt,int hd)
{
	if(L<=l&&r<=R){
		s[rt].head = hd;
		s[rt].d = a[hd];
		s[rt].sum = Get(l,r,hd,a[hd]);
		return ;
	}
	push_down(l,r,rt);
	int mid = (l+r)>>1;
	if(L<=mid) update(lson,hd);
	if(R>mid) update(rson,hd);
	s[rt].sum = s[rt<<1].sum + s[rt<<1|1].sum;
}
ll query(int l,int r,int rt)
{
	if(L<=l&&r<=R) return s[rt].sum;
	int mid = (l+r)>>1;
	push_down(l,r,rt);
	ll ans = 0;
	if(L<=mid) ans += query(lson);
	if(R>mid) ans += query(rson);
	return ans;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)  scanf("%lld",a+i);
	for(int i=1;i<n;i++) scanf("%lld",b+i);
	for(int i=n-1;i>=0;i--){
		suf[i] = suf[i+1] + (n-i)*b[i];
		c[i] = c[i+1] + b[i];
	}
	for(int i=2;i<=n;i++){
		int v = a[i] - a[i-1] - b[i-1];
		if(v) st.insert(pa(i,v));
	}
	build(1,n,1);
	scanf("%d",&q);
	char c[5];
	int l,x;
	while(q--){
		scanf("%s%d%d",c,&l,&x);
		if(c[0]=='+'){
			auto it = st.lower_bound(pa(l,0));
			if(l!=1){
				if(it==st.end()||it->fi!=l)	st.insert(pa(l,x));
				else{
					st.erase(it);
					pa now = *it;
					st.insert(pa(l,x+now.se));
				}
				it = st.lower_bound(pa(l,0)),it++;
			}
			L = R = l,a[l] = query(1,n,1) + x;
			while(it!=st.end()&&x>it->se)
			x -= it->se,st.erase(it++);
			if(it!=st.end()){
				 R = it->fi - 1;
				 st.erase(it);
				 pa now = *it;
				 st.insert(pa(now.fi,now.se-x));
			}else R = n;
			update(1,n,1,l);
		}else L = l,R = x,printf("%lld\n",query(1,n,1));
	}
	return 0;
}


#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
typedef pair<int,int> pr;
const int mxn = 1e5+555;
const int mxm = 1e5+555;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
const double eps = 1e-7;
const double pii = 3.1415926535898;
#define mpr make_pair
int gcd(int x,int y){if(y==0) return x; else return gcd(y,x%y);}
int qpow(int a,int b){int ans=1; while(b){ if(b&1) ans=ans*a%mod; b>>=1; a=a*a%mod; } return ans;}
int lowbit(int x){return (x&(-x));}
int qmul(int a,int b){int ans=0; while(b){ if(b&1) ans=(ans+a)%mod; b>>=1; a=(a+a)%mod; } return ans; }

int a[mxn],k[mxn],t[mxn],b[mxn],smt[mxn];
int n;

int sm[mxn<<2],L[mxn<<2],R[mxn<<2],mx[mxn<<2],tag[mxn<<2];

#define lch ((root)<<1)
#define rch ((root)<<1|1)

void maintain(int root){
    if(L[root]==R[root]) return;
    sm[root] = sm[lch] + sm[rch];
    mx[root] = max(mx[lch],mx[rch]);
    return;
}

void build(int root,int l,int r){
//    sm[root]=mx[root]=0;
    L[root]=l,R[root]=r;
    tag[root] = -99999999999999LL;
    if(l==r){
        sm[root] = b[l];
        mx[root] = b[l];
        return;
    }
    int mid = (l+r)>>1;
    build(lch,l,mid);
    build(rch,mid+1,r);
    maintain(root);
    return;
}

void down(int root){
    if(L[root]==R[root]||tag[root]==-99999999999999LL){
//        printf("cnm,root=%lld\n",root);
        tag[root]=-99999999999999LL;
        return;
    }
//    printf("lch=%lld,L[lch]=%lld,R[lch]=%lld\n",lch,L[lch],R[lch]);
    sm[lch] = tag[root] * (R[lch] - L[lch] + 1);
    sm[rch] = tag[root] * (R[rch] - L[rch] + 1);
    mx[lch] = tag[root];
    mx[rch] = tag[root];
    tag[lch] = tag[root];
    tag[rch] = tag[root];
    tag[root] = -99999999999999LL;
    return ;
}

void modify(int root,int l,int r,int k){
    if(l<=L[root]&&R[root]<=r){
        sm[root]= k  * (R[root]-L[root]+1);
        mx[root] = k;
        tag[root] = k;
//        printf("root=%lld,l=%lld,r=%lld,L[root]=%lld,R[root]=%lld,sm[root]=%lld\n",root,l,r,L[root],R[root],sm[root]);

        return;
    }
//    printf("root=%lld,l=%lld,r=%lld,L[root]=%lld,R[root]=%lld\n",root,l,r,L[root],R[root]);
//    printf("cnmeeee,root=%lld\n",root);;
    down(root);
    int mid = (L[root]+R[root])>>1;
    if(l<=mid) modify(lch,l,r,k);
    if(mid+1<=r) modify(rch,l,r,k);
    maintain(root);
//    printf("root=%lld,l=%lld,r=%lld,L[root]=%lld,R[root]=%lld,sm[root]=%lld\n",root,l,r,L[root],R[root],sm[root]);
    return;
}

int lowb(int root ,int k){
    if(L[root]==R[root]){
        if(mx[root]>=k)
            return L[root];
        else{
            return n+1;
        }
    }
    down(root);
    if(mx[lch]>=k){
        return lowb(lch,k);
    }
    else{
        return lowb(rch,k);
    }
}

int qry(int root,int l,int r){
    if(l<=L[root]&&R[root]<=r){
//        printf("root=%lld,l=%lld,r=%lld,L[root]=%lld,R[root]=%lld,sm[root]=%lld\n",root,l,r,L[root],R[root],sm[root]);
        return sm[root];
    }
////    printf("root = %lld,L[root]=%lld,R[root]=%lld,l=%lld,r=%lld\n",root,L[root],R[root],l,r);
    down(root);
    int mid = (L[root]+R[root])>>1;
    int ans = 0;
    if(l<=mid) ans += qry(lch,l,r);
    if(mid+1<=r) ans += qry(rch,l,r);
    return ans;
}

signed main(void){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=1;i<=n-1;i++){
        scanf("%lld",&k[i]);
        t[i] = t[i-1]+k[i-1];
    }
    for(int i=0;i<(mxn<<2);i++){
        mx[i]=-99999999999999LL;
    }

    t[n] = t[n-1]+k[n-1];
    for(int i=1;i<=n;i++){
        b[i] = a[i] - t[i];
        smt[i]=smt[i-1]+t[i];
//        printf("i=%lld,b[i]=%lld,t[i]=%lld,smt[i]=%lld\n",i,b[i],t[i],smt[i]);
    }

    build(1,1,n);
    int q;
    scanf("%lld",&q);
    while(q--){

        char s[5];
        int x,y;
        scanf("%s%lld%lld",s,&x,&y);
        if(s[0]=='s'){
            int ans = qry(1,x,y);
            printf("%lld\n",ans+(smt[y]-smt[x-1]));
        }
        else{
            int base = qry(1,x,x);
            int pos = lowb(1,base+y);
            pos--;

//            printf("x=%lld,pos=%lld,base+y=%lld\n",x,pos,base+y);
            modify(1,x,pos,base+y);
        }
//        for(int i=1;i<=n;i++){
//            printf("i=%lld,b[i]=%lld,t[i]=%lld,smt[i]=%lld\n",i,qry(1,i,i),t[i],smt[i]);
//        }
    }
    return 0;
}


#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
typedef pair<int,int> pr;
const int mxn = 1e5+555;
const int mxm = 1e5+555;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
const double eps = 1e-7;
const double pii = 3.1415926535898;
#define mpr make_pair
int gcd(int x,int y){if(y==0) return x; else return gcd(y,x%y);}
int qpow(int a,int b){int ans=1; while(b){ if(b&1) ans=ans*a%mod; b>>=1; a=a*a%mod; } return ans;}
int lowbit(int x){return (x&(-x));}
int qmul(int a,int b){int ans=0; while(b){ if(b&1) ans=(ans+a)%mod; b>>=1; a=(a+a)%mod; } return ans; }

int a[mxn],k[mxn],t[mxn],b[mxn],smt[mxn];
    int n;

int sm[mxn<<2],L[mxn<<2],R[mxn<<2],mx[mxn<<2],tag[mxn<<2];

#define lch ((root)<<1)
#define rch ((root)<<1|1)

void maintain(int root){
    if(L[root]==R[root]) return;
    sm[root] = sm[lch] + sm[rch];
    mx[root] = max(mx[lch],mx[rch]);
    return;
}

void build(int root,int l,int r){
//    sm[root]=mx[root]=0;
    L[root]=l,R[root]=r;
    tag[root] = -1;
    if(l==r){
        sm[root] = b[l];
        mx[root] = b[l];
        return;
    }
    int mid = (l+r)>>1;
    build(lch,l,mid);
    build(rch,mid+1,r);
    maintain(root);
    return;
}

void down(int root){
    if(L[root]==R[root]||tag[root]==-1)return;
    sm[lch] = tag[root] * (R[lch] - L[lch] + 1);
    sm[rch] = tag[root] * (R[rch] - L[rch] + 1);
    mx[lch] = tag[root];
    mx[rch] = tag[root];
    tag[lch] = tag[root];
    tag[rch] = tag[root];
    tag[root] = -1;
    return ;
}

void modify(int root,int l,int r,int k){
    if(l<=L[root]&&R[root]<=r){
        sm[root]= k  * (R[root]-L[root]+1);
        mx[root] = k;
        tag[root] = k;
        return;
    }
    down(root);
    int mid = (L[root]+R[root])>>1;
    if(l<=mid) modify(lch,l,r,k);
    if(mid+1<=r) modify(rch,l,r,k);
    maintain(root);
    return;
}

int lowb(int root ,int k){
    if(L[root]==R[root]){
        if(mx[root]>=k)
            return L[root];
        else{
            return n+1;
        }
    }
    if(mx[lch]>=k){
        return lowb(lch,k);
    }
    else{
        return lowb(rch,k);
    }
}

int qry(int root,int l,int r){
    if(l<=L[root]&&R[root]<=r){
        return sm[root];
    }
//    printf("root = %lld,L[root]=%lld,R[root]=%lld,l=%lld,r=%lld\n",root,L[root],R[root],l,r);
    down(root);
    int mid = (L[root]+R[root])>>1;
    int ans = 0;
    if(l<=mid) ans += qry(lch,l,r);
    if(mid+1<=r) ans += qry(rch,l,r);
    return ans;
}

signed main(void){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=1;i<=n-1;i++){
        scanf("%lld",&k[i]);
        t[i] = t[i-1]+k[i-1];
    }
    t[n] = t[n-1]+k[n-1];
    for(int i=1;i<=n;i++){
        b[i] = a[i] - t[i];
        smt[i]=smt[i-1]+t[i];
//        printf("i=%lld,b[i]=%lld,t[i]=%lld\n",i,b[i],t[i]);
    }

    build(1,1,n);
    int q;
    scanf("%lld",&q);
    while(q--){
        char s[5];
        int x,y;
        scanf("%s%lld%lld",s,&x,&y);
        if(s[0]=='s'){
//            printf("x=%lld,y=%lld\n",x,y);
            int ans = qry(1,x,y);
//            printf("%lld\n",ans);
            printf("%lld\n",ans+(smt[y]-smt[x-1]));
        }
        else{
            int base = qry(1,x,x);
            int pos = lowb(1,base+y);
//            printf("base=%lld,pos=%lld\n",base,pos);
            pos--;
            if(pos>=x)
                modify(1,x,pos,base+y);
            else
                modify(1,x,x,base+y);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
typedef pair<int,int> pr;
const int mxn = 1e5+555;
const int mxm = 1e5+555;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
const double eps = 1e-7;
const double pii = 3.1415926535898;
#define mpr make_pair
int gcd(int x,int y){if(y==0) return x; else return gcd(y,x%y);}
int qpow(int a,int b){int ans=1; while(b){ if(b&1) ans=ans*a%mod; b>>=1; a=a*a%mod; } return ans;}
int lowbit(int x){return (x&(-x));}
int qmul(int a,int b){int ans=0; while(b){ if(b&1) ans=(ans+a)%mod; b>>=1; a=(a+a)%mod; } return ans; }

int a[mxn],k[mxn],t[mxn],b[mxn],smt[mxn];
    int n;

int sm[mxn<<2],L[mxn<<2],R[mxn<<2],mx[mxn<<2],tag[mxn<<2];

#define lch ((root)<<1)
#define rch ((root)<<1|1)

void maintain(int root){
    if(L[root]==R[root]) return;
    sm[root] = sm[lch] + sm[rch];
    mx[root] = max(mx[lch],mx[rch]);
    return;
}

void build(int root,int l,int r){
//    sm[root]=mx[root]=0;
    L[root]=l,R[root]=r;
    tag[root] = -1;
    if(l==r){
        sm[root] = b[l];
        mx[root] = b[l];
        return;
    }
    int mid = (l+r)>>1;
    build(lch,l,mid);
    build(rch,mid+1,r);
    maintain(root);
    return;
}

void down(int root){
    if(L[root]==R[root]||tag[root]==-1)return;
    sm[lch] = tag[root] * (R[lch] - L[lch] + 1);
    sm[rch] = tag[root] * (R[rch] - L[rch] + 1);
    mx[lch] = tag[root];
    mx[rch] = tag[root];
    tag[lch] = tag[root];
    tag[rch] = tag[root];
    tag[root] = -1;
    return ;
}

void modify(int root,int l,int r,int k){
    if(l<=L[root]&&R[root]<=r){
        sm[root]= k  * (R[root]-L[root]+1);
        mx[root] = k;
        tag[root] = k;
        return;
    }
    down(root);
    int mid = (L[root]+R[root])>>1;
    if(l<=mid) modify(lch,l,r,k);
    if(mid+1<=r) modify(rch,l,r,k);
    maintain(root);
    return;
}

int lowb(int root ,int k){
    if(L[root]==R[root]){
        if(mx[root]>=k)
            return L[root];
        else{
            return n+1;
        }
    }
    if(mx[lch]>=k){
        return lowb(lch,k);
    }
    else{
        return lowb(rch,k);
    }
}

int qry(int root,int l,int r){
    if(l<=L[root]&&R[root]<=r){
        return sm[root];
    }
//    printf("root = %lld,L[root]=%lld,R[root]=%lld,l=%lld,r=%lld\n",root,L[root],R[root],l,r);
    down(root);
    int mid = (L[root]+R[root])>>1;
    int ans = 0;
    if(l<=mid) ans += qry(lch,l,r);
    if(mid+1<=r) ans += qry(rch,l,r);
    return ans;
}

signed main(void){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=1;i<=n-1;i++){
        scanf("%lld",&k[i]);
        t[i] = t[i-1]+k[i-1];
    }
    for(int i=0;i<(mxn<<2);i++){
        mx[i]=-99999999999999LL;
    }

    t[n] = t[n-1]+k[n-1];
    for(int i=1;i<=n;i++){
        b[i] = a[i] - t[i];
        smt[i]=smt[i-1]+t[i];
//        printf("i=%lld,b[i]=%lld,t[i]=%lld\n",i,b[i],t[i]);
    }

    build(1,1,n);
    int q;
    scanf("%lld",&q);
    while(q--){
        char s[5];
        int x,y;
        scanf("%s%lld%lld",s,&x,&y);
        if(s[0]=='s'){
//            printf("x=%lld,y=%lld\n",x,y);
            int ans = qry(1,x,y);
//            printf("%lld\n",ans);
            printf("%lld\n",ans+(smt[y]-smt[x-1]));
        }
        else{
            int base = qry(1,x,x);
            int pos = lowb(1,base+y);
//            printf("base=%lld,pos=%lld\n",base,pos);
            pos--;
            if(pos>=x)
                modify(1,x,pos,base+y);
            else
                modify(1,x,x,base+y);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
typedef pair<int,int> pr;
const int mxn = 1e5+555;
const int mxm = 1e5+555;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
const double eps = 1e-7;
const double pii = 3.1415926535898;
#define mpr make_pair
int gcd(int x,int y){if(y==0) return x; else return gcd(y,x%y);}
int qpow(int a,int b){int ans=1; while(b){ if(b&1) ans=ans*a%mod; b>>=1; a=a*a%mod; } return ans;}
int lowbit(int x){return (x&(-x));}
int qmul(int a,int b){int ans=0; while(b){ if(b&1) ans=(ans+a)%mod; b>>=1; a=(a+a)%mod; } return ans; }

int a[mxn],k[mxn],t[mxn],b[mxn],smt[mxn];
    int n;

int sm[mxn<<2],L[mxn<<2],R[mxn<<2],mx[mxn<<2],tag[mxn<<2];

#define lch ((root)<<1)
#define rch ((root)<<1|1)

void maintain(int root){
    if(L[root]==R[root]) return;
    sm[root] = sm[lch] + sm[rch];
    mx[root] = max(mx[lch],mx[rch]);
    return;
}

void build(int root,int l,int r){
    sm[root]=mx[root]=0;
    L[root]=l,R[root]=r;
    tag[root] = -1;
    if(l==r){
        sm[root] = b[l];
        mx[root] = b[l];
        return;
    }
    int mid = (l+r)>>1;
    build(lch,l,mid);
    build(rch,mid+1,r);
    maintain(root);
    return;
}

void down(int root){
    if(L[root]==R[root]||tag[root]==-1)return;
    sm[lch] = tag[root] * (R[lch] - L[lch] + 1);
    sm[rch] = tag[root] * (R[rch] - L[rch] + 1);
    mx[lch] = tag[root];
    mx[rch] = tag[root];
    tag[lch] = tag[root];
    tag[rch] = tag[root];
    tag[root] = -1;
    return ;
}

void modify(int root,int l,int r,int k){
    if(l<=L[root]&&R[root]<=r){
        sm[root]= k  * (R[root]-L[root]+1);
        mx[root] = k;
        tag[root] = k;
        return;
    }
    down(root);
    int mid = (L[root]+R[root])>>1;
    if(l<=mid) modify(lch,l,r,k);
    if(mid+1<=r) modify(rch,l,r,k);
    maintain(root);
    return;
}

int lowb(int root ,int k){
    if(L[root]==R[root]){
        if(mx[root]>=k)
            return L[root];
        else{
            return n+1;
        }
    }
    if(mx[lch]>=k){
        return lowb(lch,k);
    }
    else{
        return lowb(rch,k);
    }
}

int qry(int root,int l,int r){
    if(l<=L[root]&&R[root]<=r){
        return sm[root];
    }
//    printf("root = %lld,L[root]=%lld,R[root]=%lld,l=%lld,r=%lld\n",root,L[root],R[root],l,r);
    down(root);
    int mid = (L[root]+R[root])>>1;
    int ans = 0;
    if(l<=mid) ans += qry(lch,l,r);
    if(mid+1<=r) ans += qry(rch,l,r);
    return ans;
}

signed main(void){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=1;i<=n-1;i++){
        scanf("%lld",&k[i]);
        t[i] = t[i-1]+k[i-1];
    }
    t[n] = t[n-1]+k[n-1];
    for(int i=1;i<=n;i++){
        b[i] = a[i] - t[i];
        smt[i]=smt[i-1]+t[i];
//        printf("i=%lld,b[i]=%lld,t[i]=%lld\n",i,b[i],t[i]);
    }

    build(1,1,n);
    int q;
    scanf("%lld",&q);
    while(q--){
        char s[5];
        int x,y;
        scanf("%s%lld%lld",s,&x,&y);
        if(s[0]=='s'){
//            printf("x=%lld,y=%lld\n",x,y);
            int ans = qry(1,x,y);
//            printf("%lld\n",ans);
            printf("%lld\n",ans+(smt[y]-smt[x-1]));
        }
        else{
            int base = qry(1,x,x);
            int pos = lowb(1,base+y);
//            printf("base=%lld,pos=%lld\n",base,pos);
            pos --;
            if(pos>=x)
            modify(1,x,pos,base+y);
            else
                modify(1,x,x,base+y);
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int ll
typedef pair<int,int> pr;
const int mxn = 1e5+555;
const int mxm = 1e5+555;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
const double eps = 1e-7;
const double pii = 3.1415926535898;
#define mpr make_pair
int gcd(int x,int y){if(y==0) return x; else return gcd(y,x%y);}
int qpow(int a,int b){int ans=1; while(b){ if(b&1) ans=ans*a%mod; b>>=1; a=a*a%mod; } return ans;}
int lowbit(int x){return (x&(-x));}
int qmul(int a,int b){int ans=0; while(b){ if(b&1) ans=(ans+a)%mod; b>>=1; a=(a+a)%mod; } return ans; }

int a[mxn],k[mxn],t[mxn],b[mxn],smt[mxn];
int n;

int sm[mxn<<2],L[mxn<<2],R[mxn<<2],mx[mxn<<2],tag[mxn<<2];

#define lch ((root)<<1)
#define rch ((root)<<1|1)

void maintain(int root){
    if(L[root]==R[root]) return;
    sm[root] = sm[lch] + sm[rch];
    mx[root] = max(mx[lch],mx[rch]);
    return;
}

void build(int root,int l,int r){
//    sm[root]=mx[root]=0;
    L[root]=l,R[root]=r;
    tag[root] = -1;
    if(l==r){
        sm[root] = b[l];
        mx[root] = b[l];
        return;
    }
    int mid = (l+r)>>1;
    build(lch,l,mid);
    build(rch,mid+1,r);
    maintain(root);
    return;
}

void down(int root){
    if(L[root]==R[root]||tag[root]==-1)return;
    sm[lch] = tag[root] * (R[lch] - L[lch] + 1);
    sm[rch] = tag[root] * (R[rch] - L[rch] + 1);
    mx[lch] = tag[root];
    mx[rch] = tag[root];
    tag[lch] = tag[root];
    tag[rch] = tag[root];
    tag[root] = -1;
    return ;
}

void modify(int root,int l,int r,int k){
    if(l<=L[root]&&R[root]<=r){
        sm[root]= k  * (R[root]-L[root]+1);
        mx[root] = k;
        tag[root] = k;
        return;
    }
    down(root);
    int mid = (L[root]+R[root])>>1;
    if(l<=mid) modify(lch,l,r,k);
    if(mid+1<=r) modify(rch,l,r,k);
    maintain(root);
    return;
}

int lowb(int root ,int k){
    if(L[root]==R[root]){
        if(mx[root]>=k)
            return L[root];
        else{
            return n+1;
        }
    }
    down(root);
    if(mx[lch]>=k){
        return lowb(lch,k);
    }
    else{
        return lowb(rch,k);
    }
}

int qry(int root,int l,int r){
    if(l<=L[root]&&R[root]<=r){
        return sm[root];
    }
//    printf("root = %lld,L[root]=%lld,R[root]=%lld,l=%lld,r=%lld\n",root,L[root],R[root],l,r);
    down(root);
    int mid = (L[root]+R[root])>>1;
    int ans = 0;
    if(l<=mid) ans += qry(lch,l,r);
    if(mid+1<=r) ans += qry(rch,l,r);
    return ans;
}

signed main(void){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=1;i<=n-1;i++){
        scanf("%lld",&k[i]);
        t[i] = t[i-1]+k[i-1];
    }
    for(int i=0;i<(mxn<<2);i++){
        mx[i]=-99999999999999LL;
    }

    t[n] = t[n-1]+k[n-1];
    for(int i=1;i<=n;i++){
        b[i] = a[i] - t[i];
        smt[i]=smt[i-1]+t[i];
//        printf("i=%lld,b[i]=%lld,t[i]=%lld,smt[i]=%lld\n",i,b[i],t[i],smt[i]);
    }

    build(1,1,n);
    int q;
    scanf("%lld",&q);
    while(q--){

        char s[5];
        int x,y;
        scanf("%s%lld%lld",s,&x,&y);
        if(s[0]=='s'){
            int ans = qry(1,x,y);
            printf("%lld\n",ans+(smt[y]-smt[x-1]));
        }
        else{
            int base = qry(1,x,x);
            int pos = lowb(1,base+y);
            pos--;
//            printf("pos=%lld\n",pos);
            modify(1,x,pos,base+y);
        }
//    for(int i=1;i<=n;i++){
//        printf("i=%lld,b[i]=%lld,t[i]=%lld,smt[i]=%lld\n",i,qry(1,i,i),t[i],smt[i]);
//    }
    }
    return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc];
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=k;val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int l=x,r=n,res=l,now=query(x,x,1,n,1);
			while(l<=r) {
				int mid=(l+r)>>1;
				if(query(mid,mid,1,n,1)<=now+y)res=mid,l=mid+1;
				else r=mid-1;
			}
			update(x,res,1,n,1,now+y);
		}
	}
	return 0;
}///


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char buf[1<<21],*p1=buf,*p2=buf;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
inline int rdc() {
	char ch=getchar();
	while(ch!='?'&&ch!='s')ch=getchar();
	return ch=='s';
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],miv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],miv[p]=std::min(miv[lc],miv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=miv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	miv[lc]=miv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=miv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(miv[rc]<=v)return ask(v,mid+1,r,rc);
	else return ask(v,l,mid,lc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	for(int q=rd();q;--q) {
		int opt=rdc(),x=rd(),y=rd();
		if(opt)printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}


#pragma GCC optimize("Ofast","-funroll-loops","-fdelete-null-pointer-checks")
#pragma GCC target("ssse3","sse3","sse2","sse","avx2","avx")
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char buf[1<<21],*p1=buf,*p2=buf;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch))x=x*10+(ch^48),ch=getchar();
	return x*f;
}
inline int rdc() {
	char ch=getchar();
	while(ch!='+'&&ch!='s')ch=getchar();
	return ch=='s';
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],miv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],miv[p]=std::min(miv[lc],miv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=miv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	miv[lc]=miv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=miv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(miv[rc]<=v)return ask(v,mid+1,r,rc);
	else return ask(v,l,mid,lc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	for(int q=rd();q;--q) {
		int opt=rdc(),x=rd(),y=rd();
		if(opt)printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}
//zky txdy!


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc];
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=k;val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int l=x,r=n,res=l,now=query(x,x,1,n,1);
			while(l<=r) {
				int mid=(l+r)>>1;
				if(query(mid,mid,1,n,1)<=now+y)res=mid,l=mid+1;
				else r=mid-1;
			}
			update(x,res,1,n,1,now+y);
		}
	}
	return 0;
}//为啥交不上去啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc];
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=k;val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int l=x,r=n,res=l,now=query(x,x,1,n,1);
			while(l<=r) {
				int mid=(l+r)>>1;
				if(query(mid,mid,1,n,1)<=now+y)res=mid,l=mid+1;
				else r=mid-1;
			}
			update(x,res,1,n,1,now+y);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char buf[1<<21],*p1=buf,*p2=buf;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch))x=x*10+(ch^48),ch=getchar();
	return x*f;
}
inline int rdc() {
	char ch=getchar();
	while(ch!='+'&&ch!='s')ch=getchar();
	return ch=='s';
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],miv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],miv[p]=std::min(miv[lc],miv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=miv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	miv[lc]=miv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=miv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(miv[rc]<=v)return ask(v,mid+1,r,rc);
	else return ask(v,l,mid,lc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	for(int q=rd();q;--q) {
		int opt=rdc(),x=rd(),y=rd();
		if(opt)printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}
//zky txdy!


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],mxv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],mxv[p]=max(mxv[lc],mxv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=mxv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	mxv[lc]=mxv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=mxv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	int mid=(l+r)>>1;
	if(mxv[rc]>v)return ask(v,l,mid,lc);
	else return ask(v,mid+1,r,rc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],mxv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc];
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=mxv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	mxv[lc]=mxv[rc]=tag[p];
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=mxv[p]=k;val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	int mid=(l+r)>>1;
	if(mxv[rc]>v)return ask(v,l,mid,lc);
	else return ask(v,mid+1,r,rc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else update(x,ask(query(x,x,1,n,1),1,n,1),1,n,1,now+y);
	}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],miv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],miv[p]=std::min(miv[lc],miv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=miv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	miv[lc]=miv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=miv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(miv[rc]<=v)return ask(v,mid+1,r,rc);
	else return ask(v,l,mid,lc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],mxv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc];
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=mxv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	mxv[lc]=mxv[rc]=tag[p];
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=mxv[p]=k;val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	int mid=(l+r)>>1;
	if(mxv[rc]>v)return ask(v,l,mid,lc);
	else return ask(v,mid+1,r,rc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],mxv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],mxv[p]=std::max(mxv[lc],mxv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=mxv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	mxv[lc]=mxv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=mxv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(mxv[rc]>v)return ask(v,l,mid,lc);
	else return ask(v,mid+1,r,rc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1)+1,1,n,1,now+y);
		}
	}
	return 0;
}//为啥又交不上去hh啊啊啊啊啊啊啊啊啊啊


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char buf[1<<21],*p1=buf,*p2=buf;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch))x=x*10+(ch^48),ch=getchar();
	return x*f;
}
inline int rdc() {
	char ch=getchar();
	while(ch!='?'&&ch!='s')ch=getchar();
	return ch=='s';
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],miv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],miv[p]=std::min(miv[lc],miv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=miv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	miv[lc]=miv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=miv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(miv[rc]<=v)return ask(v,mid+1,r,rc);
	else return ask(v,l,mid,lc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	for(int q=rd();q;--q) {
		int opt=rdc(),x=rd(),y=rd();
		if(opt)printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
char buf[1<<21],*p1=buf,*p2=buf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],miv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],miv[p]=std::min(miv[lc],miv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=miv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	miv[lc]=miv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=miv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(miv[rc]<=v)return ask(v,mid+1,r,rc);
	else return ask(v,l,mid,lc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f=(ch=='-'?0:f),ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],mxv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],mxv[p]=std::max(mxv[lc],mxv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=mxv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	mxv[lc]=mxv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=mxv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	printf("%lld %lld %lld %lld %lld\n",v,l,r,mxv[lc],mxv[rc]);
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(mxv[rc]>v)return ask(v,l,mid,lc);
	else return ask(v,mid+1,r,rc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	char opt[7];int x,y;
	for(int q=rd();q;--q) {
		scanf("%s%lld%lld",opt,&x,&y);
		if(opt[0]=='s')printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			printf("debug:%lld\n",ask(now+y,1,n,1));
			update(x,ask(now+y,1,n,1)+1,1,n,1,now+y);
		}
	}
	return 0;
}//为啥又交不上去hh啊啊啊啊啊啊啊啊啊啊


#include<bits/stdc++.h>
#define int long long
#define N 100009
const int inf=1e18;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char buf[1<<21],*p1=buf,*p2=buf;
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch))x=x*10+(ch^48),ch=getchar();
	return x*f;
}
inline int rdc() {
	char ch=getchar();
	while(ch!='+'&&ch!='s')ch=getchar();
	return ch=='s';
}
int a[N],k[N],s[N],v[N],n,ss[N];
int val[N<<2],tag[N<<2],miv[N<<2];
#define lc (p<<1)
#define rc (p<<1|1)
void pushup(int p) {
	val[p]=val[lc]+val[rc],miv[p]=std::min(miv[lc],miv[rc]);
}
void build(int l,int r,int p) {
	tag[p]=inf;
	if(l==r)return val[p]=miv[p]=v[l],void();
	int mid=(l+r)>>1;
	build(l,mid,lc),build(mid+1,r,rc);
	pushup(p);
}
void pushdown(int p,int l,int r) {
	if(tag[p]==inf)return;
	int mid=(l+r)>>1;
	tag[lc]=tag[rc]=tag[p];
	miv[lc]=miv[rc]=tag[p];
	val[lc]=tag[p]*(mid-l+1);
	val[rc]=tag[p]*(r-mid);
	tag[p]=inf;
}
int query(int ql,int qr,int l,int r,int p) {
	if(ql<=l&&r<=qr)return val[p];
	pushdown(p,l,r);
	int mid=(l+r)>>1,res=0;
	if(ql<=mid)res+=query(ql,qr,l,mid,lc);
	if(mid<qr)res+=query(ql,qr,mid+1,r,rc);
	return res;
}
void update(int ql,int qr,int l,int r,int p,int k) {
	if(ql<=l&&r<=qr) {
		tag[p]=miv[p]=k,val[p]=k*(r-l+1);return;
	}
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(ql<=mid)update(ql,qr,l,mid,lc,k);
	if(mid<qr)update(ql,qr,mid+1,r,rc,k);
	pushup(p);
}
int ask(int v,int l,int r,int p) {
	if(l==r)return l;
	pushdown(p,l,r);
	int mid=(l+r)>>1;
	if(miv[rc]<=v)return ask(v,mid+1,r,rc);
	else return ask(v,l,mid,lc);
}
signed main() {
	n=rd();
	for(int i=1;i<=n;++i)a[i]=rd();
	for(int i=2;i<=n;++i)k[i]=rd(),s[i]=s[i-1]+k[i],ss[i]=ss[i-1]+s[i];
	for(int i=1;i<=n;++i)v[i]=a[i]-s[i];
	build(1,n,1);
	for(int q=rd();q;--q) {
		int opt=rdc(),x=rd(),y=rd();
		if(opt)printf("%lld\n",query(x,y,1,n,1)+ss[y]-ss[x-1]);
		else {
			int now=query(x,x,1,n,1);
			update(x,ask(now+y,1,n,1),1,n,1,now+y);
		}
	}
	return 0;
}


/*
code by: zstu wxk
time: 2019/03/01
*/
#include<bits/stdc++.h>
using namespace std;
#define Fopen freopen("_in.txt","r",stdin); freopen("_out.txt","w",stdout);
#define LL long long
#define ULL unsigned LL
#define fi first
#define se second
#define pb push_back
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define lch(x) tr[x].son[0]
#define rch(x) tr[x].son[1]
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
typedef pair<int,int> pll;
const int inf = 0x3f3f3f3f;
const int _inf = 0xc0c0c0c0;
const LL INF = 0x3f3f3f3f3f3f3f3f;
const LL _INF = 0xc0c0c0c0c0c0c0c0;
const LL mod =  (int)1e9+7;
const int N = 1e5 + 100;
int n, k, t1, t2;
int a[N];
bool check(int x){
    for(int i = 2; i * i <= x; ++i){
        if(x % i == 0){
            t1 = i, t2 = x/i;
            if(t1 < n - 2 && t2 < 1e6 * t1){
                return true;
            }
        }
    }
    return false;
}
void Ac(){
    n = 2000;
    memset(a, 0, sizeof a);
    for(n = 2000; n >= 1; --n){
        if(check(n+k)){
            for(int i = 1; i <= t1; ++i){
                if(t2 >= 1e6){
                    a[i] = 1e6;
                    t2 -= 1e6;
                }
                else{
                    a[i] = t2;
                    t2 = 0;
                }
            }
            a[t1+1] = -1;
            printf("%d\n", n);
            for(int i = 1; i <= n; ++i){
                printf("%d ", a[i]);
            }
            break;
        }
    }
}
int main(){
    while(~scanf("%d", &k)){
        Ac();
    }
    return 0;
}


/**
code by: zstu wxk
time: 2019/03/01
Problem Link: http://codeforces.com/contest/1130/problem/E
solve:
    如果构造的数列是 0 0 0 0 0 0 0 -1 + + + +(+代表大于0的数)
        那么 find_answer = sum(+) * len_+
        实际上的答案为 tot_len * [sum(+) - 1]
        即: sum(+) * len_+ + k = tot_len * [sum(+) - 1]
        接下来就是枚举tot_len就好了
**/
#include<bits/stdc++.h>
using namespace std;
#define Fopen freopen("_in.txt","r",stdin); freopen("_out.txt","w",stdout);
#define LL long long
#define ULL unsigned LL
#define fi first
#define se second
#define pb push_back
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define lch(x) tr[x].son[0]
#define rch(x) tr[x].son[1]
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
typedef pair<int,int> pll;
const int inf = 0x3f3f3f3f;
const int _inf = 0xc0c0c0c0;
const LL INF = 0x3f3f3f3f3f3f3f3f;
const LL _INF = 0xc0c0c0c0c0c0c0c0;
const LL mod =  (int)1e9+7;
const int N = 1e5 + 100;
int n, k, t1, t2;
int a[N];
bool check(int x){
    for(int i = 2; i * i <= x; ++i){
        if(x % i == 0){
            t1 = i, t2 = x/i;
            t1 = n - t1;
            if(t1 < n - 2 && t2 < 1e6 * t1)
                return true;
        }
    }
    return false;
}
void Ac(){
    n = 2000;
    memset(a, 0, sizeof a);
    for(n = 2000; n >= 1; --n){
        if(check(n+k)){
            for(int i = 1; i <= t1; ++i){
                if(t2 >= 1e6){
                    a[i] = 1e6;
                    t2 -= 1e6;
                }
                else{
                    a[i] = t2;
                    t2 = 0;
                }
            }
            a[t1+1] = -1;
            printf("%d\n", n);
            reverse(a+1, a+1+n);
            for(int i = 1; i <= n; ++i){
                printf("%d ", a[i]);
            }
            break;
        }
    }
}
int main(){
    while(~scanf("%d", &k)){
        Ac();
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=5010;

int k,v,a,b;
int main()
{
	scanf("%d",&k);
	int n=2000;
	v=1;
	while(1){
		int f1=0,f2=0;
		if((k+v)%n==0) f1=1;
		if(f1&&(k+v)/n-v<0) f2=1;
		if(f1&&f2) break;
		v++;
	}
	a=v;
	b=(k+v)/n-a;
	printf("%d\n",n);
	for(int i=1;i<=n-2;i++) printf("0 ");
	printf("%d %d\n",b,a);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=5010;

int k,v,a,b;
int main()
{
	scanf("%d",&k);
	int n=2000;
	v=1;
	while(1){
		int f1=0,f2=0;
		if(f1&&(k+v)/n-v<0) f2=1;
		if(f1&&f2) break;
		v++;
	}
	a=v;
	b=(k+v)/n-a;
	printf("%d\n",n);
	for(int i=1;i<=n-2;i++) printf("0 ");
	printf("%d %d\n",b,a);
	return 0;
}


#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<stack>
using namespace std;
#define ll long long
#define ull unsigned long long
#define up(i,a,b) for(register int i=(a);i<=(b);i++)
#define down(i,a,b) for(register int i=(a);i>=(b);i--)
#define mem(x,y) memset(x,(y),sizeof x)
#define ff first
#define ss second
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define sc(a) scanf("%d",&a)
#define scl(a) scanf("%I64d",&a)
#define scs(a) scanf("%s",a)
#define pr(a,b) printf("%d%c",a,b)
#define prl(a,b) printf("%I64d%c",a,b)
#define PQ priority_queue
#define ld long double
#define all(v) v.begin(),v.end()
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define GG {gg++;break;}

typedef pair<ll,int> pii;
typedef map<int,int> mii;
typedef vector<int> V;

template<typename T>
inline void read(T& input) {
	input=0;
	int v=1;
	char c=getchar();
	while((c<'0'||c>'9')&&c!='-')c=getchar();
	if(c=='-')v=-1,c=getchar();
	while(c>='0'&&c<='9')input=input*10+c-'0',c=getchar();
	input*=v;
}

template<typename T>
inline T gcd(T a,T b) {
	return !b?a:gcd(b,a%b);
}

int main() {
	int n;sc(n);
	up(k,1,1000){
		ll base=n+2*k*k+k;
		ll y=base/(2*k);
		if(base%(2*k))y++;
		ll x=1ll*(2*k+1)*y-base;
		if(x<=1e6-1&&y<=1e6&&2*k+1<=2000){
			pr(2*k+1,'\n');
			up(i,1,k)prl(x,' '),prl(-(x+1),' ');
			prl(y,'\n');
			return 0;
		}
	}
	pr(-1,'\n');
}


#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<stack>
using namespace std;
#define ll long long
#define ull unsigned long long
#define up(i,a,b) for(auto i=(a);i<=(b);i++)
#define down(i,a,b) for(auto i=(a);i>=(b);i--)
#define mem(x,y) memset(x,(y),sizeof x)
#define ff first
#define ss second
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define sc(a) scanf("%d",&a)
#define scl(a) scanf("%I64d",&a)
#define scs(a) scanf("%s",a)
#define pr(a,b) printf("%d%c",a,b)
#define prl(a,b) printf("%I64d%c",a,b)
#define PQ priority_queue
#define ld long double
#define all(v) v.begin(),v.end()
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define GG {gg++;break;}

typedef pair<ll,int> pii;
typedef map<int,int> mii;
typedef vector<int> V;

template<typename T>
inline void read(T& input) {
	input=0;
	int v=1;
	char c=getchar();
	while((c<'0'||c>'9')&&c!='-')c=getchar();
	if(c=='-')v=-1,c=getchar();
	while(c>='0'&&c<='9')input=input*10+c-'0',c=getchar();
	input*=v;
}

template<typename T>
inline T gcd(T a,T b) {
	return !b?a:gcd(b,a%b);
}

int main(){
	IOS;
	int n;cin>>n;
	up(k,1,2000){
		int base=n+k+2;
		int chu=base/(k+1),less=base%(k+1);
		int x=chu+(!less?0:1);
		int y=base-x*k;
		if(x<=1e6&&y<=1e6){
			pr(k+2,'\n');
			pr(-1,' ');
			up(i,1,k)pr(x,' ');
			pr(y,'\n');
			return 0;
		}
	}
	pr(-1,'\n');
}


#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<stack>
using namespace std;
#define ll long long
#define ull unsigned long long
#define up(i,a,b) for(register int i=(a);i<=(b);i++)
#define down(i,a,b) for(register int i=(a);i>=(b);i--)
#define mem(x,y) memset(x,(y),sizeof x)
#define ff first
#define ss second
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define sc(a) scanf("%d",&a)
#define scl(a) scanf("%I64d",&a)
#define scs(a) scanf("%s",a)
#define pr(a,b) printf("%d%c",a,b)
#define prl(a,b) printf("%I64d%c",a,b)
#define PQ priority_queue
#define ld long double
#define all(v) v.begin(),v.end()
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define GG {gg++;break;}

typedef pair<ll,int> pii;
typedef map<int,int> mii;
typedef vector<int> V;

template<typename T>
inline void read(T& input) {
	input=0;
	int v=1;
	char c=getchar();
	while((c<'0'||c>'9')&&c!='-')c=getchar();
	if(c=='-')v=-1,c=getchar();
	while(c>='0'&&c<='9')input=input*10+c-'0',c=getchar();
	input*=v;
}

template<typename T>
inline T gcd(T a,T b) {
	return !b?a:gcd(b,a%b);
}

int main() {
	int n;sc(n);
	up(k,1,1000){
		ll base=n+2*k*k+k;
		ll y=base/(2*k);
		if(base%(2*k))y++;
		ll x=1ll*(2*k+1)*y-base;
		if(x<=1e6&&y<=1e6&&2*k+1<=2000){
			pr(2*k+1,'\n');
			up(i,1,k)prl(x,' '),prl(-(x+1),' ');
			prl(y,'\n');
			return 0;
		}
	}
	pr(-1,'\n');
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	int k, n = 2000;
	cin >> k;
	cout << n << endl << -1;
	int s = k + 2000;
	for (int i = 0; i < n - 1; i++) {
		int val = min(s,int(1e6));
		s = s - val;
		cout << " " << val;
	}
	return 0;
}/*
-1 0 0 0 0 0 n
ans1 = S * 1999
ans2 = (S - 1) * 2000
k = S - 2000
S = k + 2000
*/


#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	int k, n = 2000;
	cin >> k;
	cout << n << endl << -1;
	int s = k + 2000;
	for (int i = 0; i < n - 1; i++) {
		int val = min(s, 2000);
		s = s - val;
		cout << " " << val;
	}
	return 0;
}/*
-1 0 0 0 0 0 n
ans1 = S * 1999
ans2 = (S - 1) * 2000
k = S - 2000
S = k + 2000
*/


#include <bits/stdc++.h>
#define mid ((l+r)>>1)
#define pb push_back
#define lb(x) (x&(-x))
#define getchar()(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<25,stdin),p1==p2)?EOF:*p1++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> Pr;
char buf[1<<25],*p1=buf,*p2=buf;
inline int read(){
	int x=0,f=1;
	char ch;
	while(!isdigit(ch=getchar())) if(ch=='-') f=-1;
	x=ch-'0';
	while(isdigit(ch=getchar())) x=x*10+ch-'0';
	return x*f;
}
int main(){
//  ios::sync_with_stdio(0);
	ll k=read();
	cout<<2000<<endl;
	for(int i=1;i<=1998;i++) cout<<0<<" ";
	for(int i=1;i<=1000000;i++){
		ll a=i,b=k-1999ll*a;
		if(b>0) continue;
		if((-b)%2000) continue;
		b/=2000;
		cout<<b<<" "<<a;
		return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
#define mid ((l+r)>>1)
#define pb push_back
#define lb(x) (x&(-x))
#define getchar()(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<25,stdin),p1==p2)?EOF:*p1++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> Pr;
char buf[1<<25],*p1=buf,*p2=buf;
inline int read(){
	int x=0,f=1;
	char ch;
	while(!isdigit(ch=getchar())) if(ch=='-') f=-1;
	x=ch-'0';
	while(isdigit(ch=getchar())) x=x*10+ch-'0';
	return x*f;
}
int main(){
//  ios::sync_with_stdio(0);
	int k=read();
	cout<<2000<<endl;
	for(int i=1;i<=1998;i++) cout<<0<<" ";
	for(int i=1;i<=100000;i++){
		ll a=i,b=k-1999*a;
		if(b%2000) continue;
		b/=2000;
		cout<<b<<" "<<a;
		return 0;
	}

	return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC optimize ("expensive-optimizations")

#include<bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef short int sh;
typedef unsigned short int ush;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
constexpr sh infs=3e4+7;
constexpr int inf=1e9+7;
constexpr ll infl=1e18+7;

vector<int>r;
vector<int>p;
bool cp[2007];
void sito(){
	cp[0]=cp[1]=1;
	for(int i=2; i<=2000; i++){
		if(cp[i]) continue;
		p.push_back(i);
		for(int j=i; j<=2000; j+=i) cp[j]=1;
	}
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int k,k2,a,x,xd;
	cin>>k;

	sito();
	for(int i=1; i<=10; i++){
		k++;
		k2=k;
		for(int j=0; j<p.size(); j++){
			if(p[j]>i||p[j]>k2) break;
			while(!(k2%p[j])){
				r.push_back(p[j]);
				k2/=p[j];
			}
			if(k2==1) break;
		}
		bool ok=0;

		//cout<<"k="<<k<<' ';
		//for(int j=0; j<r.size(); j++) cout<<r[j]<<' ';
		//cout<<'\n';

		for(int j=0; j<(1<<r.size()); j++){
			xd=1;
			for(int w=0; w<r.size(); w++) if((1<<w)&j) xd*=r[w];
			if(xd>=i||xd>2000||k/xd>=i) continue;
			a=k/xd;
			x=xd;
			ok=1;
		}

		r.clear();
		//cout<<"i="<<i<<" a="<<a<<" x="<<x<<'\n';
		if(ok){
			cout<<x<<'\n';
			for(int j=1; j<=x-(i-a)-1; j++) cout<<0<<' ';
			for(int j=1; j<=i-a; j++) cout<<-1<<' ';
			cout<<i;
			return 0;
		}
	}
	cout<<-1;
	return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC optimize ("expensive-optimizations")

#include<bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef short int sh;
typedef unsigned short int ush;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
constexpr sh infs=3e4+7;
constexpr int inf=1e9+7;
constexpr ll infl=1e18+7;

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int k,n=2000,s;
	cin>>k;
	s=k+n-1;

	cout<<n<<'\n'<<-1<<' ';

	for(int i=2; i<=n; i++){
		cout<<min(1000000,s)<<' ';
		s-=min(1000000,s);
	}

	return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC optimize ("expensive-optimizations")

#include<bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef short int sh;
typedef unsigned short int ush;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
constexpr sh infs=3e4+7;
constexpr int inf=1e9+7;
constexpr ll infl=1e18+7;

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int k,n=2000,s;
	cin>>k;
	s=k+n;

	cout<<n<<'\n'<<-1<<' ';

	for(int i=2; i<=n; i++){
		cout<<min(1000000,s)<<' ';
		s-=min(1000000,s);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define db double
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define what_is(x) cerr <<  "Line " << __LINE__ << ": " << #x << " is " << (x) << endl;
#define suf_zero(x) __builtin_ffs(x)
#define pre_zero(x) __builtin_clz(x)
#define num_one(x) __builtin_popcount(x)
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mt make_tuple
#define eb emplace_back
#define INFI 2000000009
#define INFLL (ll)1e18+7
#define ig ignore
#define fi first
#define TP tuple<int, int, int>
#define se second
#define lson l, mid, rt<<1
#define rson mid+1, r, rt<<1|1
#define PII pair<int, int>
//void print(__int128 x){if(x>9)print(x/10);putchar('0'+x%10);}
#define rep(i, begin, end) for(__typeof(end) i =(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
void err(istream_iterator<string> it) {cerr<<endl;}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << " , ";
    err(++it, args...);
}// fast IO
const double PI = acos(-1.0);
const double eps = 1e-8;
///////// Macro ////////////////
const int maxn = 3e5+7;
const int N = 20000+10;
#define pii pair<int,int>

#define LL long long
#define PB push_back
#define MP make_pair
#define inf 0x3f3f3f3f
const int mod=998244353;

//2019年2月25日 17:49:22

int a[N];
int main() {
    //freopen("in.txt","r",stdin);
	int k;
	cin>>k;
	int n=1002;
	a[1]=-1;
	k--;
	int sum=k+n+1;
	int id=1;
	while(sum){
		if(sum >= 1000000)a[++id] =1e6;
		else a[++id] =sum;
		sum-=min(sum,1000000);
	}
	cout<<n<<endl;
	for(int i=1;i<=n;++i){
		printf("%d%c",a[i],i==n?'\n':' ');
	}

}