#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;

struct UnionFind{
	vector<int> par,rank,mx;
	UnionFind(int N){
		par.assign(N,0);
		rank.assign(N,0);
		mx.assign(N,0);
		rep(i,N) par[i]=i,mx[i]=i;
	}
	int find(int x){
		if(par[x]==x) return x;
		return par[x]=find(par[x]);
	}
	bool same(int x,int y){
		return find(x)==find(y);
	}
	void unite(int x,int y){
		x=find(x),y=find(y);
		if(x==y) return;
		if(rank[x]<rank[y]){
			par[x]=y;
			chmax(mx[y],mx[x]);
		}else{
			par[y]=x;
			chmax(mx[x],mx[y]);
			if(rank[x]==rank[y]) rank[x]++;
		}
	}
};

int N,Q;
ll p[200010];

int main(){
	cin>>N;
	rep(i,N-1) cin>>p[i];

	UnionFind UF(2100000);
	vector<int> v(2100000);
	rep(i,2100000) v[i] = i;
	int s = 0;

	for(int i=N-2;i>=2;i--){
		rep(j,p[i]+1) UF.unite(v[s+p[i]+j],v[s+p[i]-j]);
		s += p[i];
	}

	cin>>Q;
	rep(i,Q){
		// cin>>p[N-1];
		// ll x = p[N-1];
		// for(int i=N-2;i>=2;i--){
		// 	x -= p[i];
		// 	x = abs(x);
		// }
		// ll ans = x + p[0] - p[1];
		// cout<<ans<<endl;
		ll a;
		cin>>a;
		if(a>=2100000){
			cout<<a-s+p[0]-p[1]<<endl;
			continue;
		}else{
			cout<<UF.mx[UF.find(a)] - s + p[0]-p[1]<<endl;
		}
	}
}
