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

#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define REACH cerr<<"reached line "<<__LINE__<<endl
#define DBG(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl

using uint=unsigned int;
using ll=long long;
using pii=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

int read(){
	int i;
	scanf("%d",&i);
	return i;
}

ll readLL(){
	ll i;
	scanf("%lld",&i);
	return i;
}

string readString(){
	static char buf[3341919];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341919];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

template<class T,class U>
void chmin(T& a,U b){
	if(a>b)
		a=b;
}

template<class T>
T Sq(const T& t){
	return t*t;
}

struct Node{
	using NP=Node*;
	NP l,r;
	bool rev;
	int ansId,cur,a,b,key;
	Node():l(NULL),r(NULL),rev(false){
		key=rand();
	}
	void Propagate(){
		if(rev){
			swap(l,r);
			if(l) l->rev^=true;
			if(r) r->rev^=true;
			rev=false;
		}
		cur=cur*a+b;
		if(l){
			l->a*=a;
			l->b=l->b*a+b;
		}
		if(r){
			r->a*=a;
			r->b=r->b*a+b;
		}
		a=1;
		b=0;
	}
} ns[201919];

using NP=Node::NP;

NP Merge(NP x,NP y){
	if(!x)return y;
	if(!y)return x;
	if(x->key>y->key){
		x->Propagate();
		x->r=Merge(x->r,y);
		return x;
	}else{
		y->Propagate();
		y->l=Merge(x,y->l);
		return y;
	}
}

pair<NP,NP> Split(NP x,int v){
	if(!x)return MP(NP(NULL),NP(NULL));
	x->Propagate();
	if(x->cur<=v){
		auto r=Split(x->r,v);
		x->r=r.first;
		return MP(x,r.second);
	}else{
		auto l=Split(x->l,v);
		x->l=l.second;
		return MP(l.first,x);
	}
}

NP MLN(NP x){
	while(1){
		x->Propagate();
		if(x->l)
			x=x->l;
		else
			break;
	}
	return x;
}

NP MRN(NP x){
	while(1){
		x->Propagate();
		if(x->r)
			x=x->r;
		else
			break;
	}
	return x;
}

void ansDfs(NP x,vi& dst){
	if(!x)
		return;
	x->Propagate();
	dst[x->ansId]=x->cur;
	ansDfs(x->l,dst);
	ansDfs(x->r,dst);
}

int main(){
	int n=read();
	vi a;
	REP(i,n-1)
		a.PB(read());
	int m=read();
	NP root=NULL;
	vector<pii> buf;
	REP(i,m)
		buf.PB(MP(read(),i));
	sort(buf.begin(),buf.end());
	REP(i,m){
		NP x=&ns[i];
		x->ansId=buf[i].second;
		x->cur=buf[i].first;
		x->a=1;
		x->b=0;
		root=Merge(root,x);
	}
	for(int i=(int)a.size()-1;i>=2;i--){
		int w=a[i];
		auto p=Split(root,w);
		if(p.first){
			p.first->rev^=true;
			p.first->a*=-1;
			p.first->b=-p.first->b+w;
		}
		if(p.second)
			p.second->b-=w;
		while(p.first&&p.second){
			NP x=MRN(p.first),y=MLN(p.second);
			if(x->cur>y->cur){
				auto q=Split(p.second,y->cur);
				auto r=Split(p.first,y->cur);
				p.first=Merge(r.first,Merge(q.first,r.second));
				p.second=q.second;
			}else
				break;
		}
		root=Merge(p.first,p.second);
	}
	vi ans(m);
	ansDfs(root,ans);
	REP(i,m){
		printf("%d\n",a[0]-(a[1]-ans[i]));
	}
}


Measured memory_bytes: 13424