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

const int p=1e9+7;
int dp[110][10010]={0};
int n,b[110],c[110],q,ans[10200]={0},range=0;

int main() {
    cin>>n;
    for(int i=0;i<n;i++)cin>>c[i];
    for(int i=0;i<n-1;i++){cin>>b[i];range+=(n-i-1)*b[i];}
    range=-1-range/n;
    for(q=range-10;q<=range+110;q++)
    {
        memset(dp,0,sizeof(dp));
        int lmt=q,sumb=0,sumc=c[0];
        for(int i=max(0,q);i<=sumc+1;i++)dp[0][i]=i-max(0,q);
        for(int i=sumc+2;i<10010;i++)dp[0][i]=dp[0][sumc+1];
        for(int i=1;i<n;i++)
        {
            sumb+=b[i-1];
            lmt+=sumb+q;
            sumc+=c[i];
            for(int j=max(0,lmt);j<=sumc;j++)
            {
                dp[i][j]=(dp[i-1][j+1]-dp[i-1][j-min(c[i],j)]+p)%p;
            }
            for(int j=max(0,lmt);j<=sumc;j++)dp[i][sumc+1]=(dp[i][sumc+1]+dp[i][j])%p;
            for(int j=sumc;j>=max(0,lmt);j--)dp[i][j]=(dp[i][j+1]-dp[i][j]+p)%p;
            for(int j=sumc+2;j<10010;j++)dp[i][j]=dp[i][sumc+1];
        }
        ans[q+10000]=dp[n-1][sumc+1];
    }
    cin>>q;
    while(cin>>q)
    {
        if(q>range+110)cout<<0<<endl;
        else if(q<range-10)cout<<ans[range+9990]<<endl;
        else cout<<ans[q+10000]<<endl;
    }
    return 0;
}