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

#define FOR(x,n) for(int x=0;x<n;x++)
#define mp make_pair
#define PI 3.14159265358979323846264338327950288
typedef long long ll;
typedef pair<int,int> ii;

const int MX = 102;
const int MX2 = MX * MX;
const ll MOD = 1e9 + 7;

int n;
ll c[MX], b[MX], pref[MX2 + 1];
ll dp[MX][MX2];

ll solve(ll x) {
  ll curr = x;
  ll req = 0;

  dp[0][0] = 1;
  for(int i = 1; i <= n; i++) {
    req += curr;
    pref[0] = 0;
    for(int j = 1; j <= MX2; j++) {
      pref[j] = (pref[j - 1] + dp[i - 1][j - 1]) % MOD;
    }

    FOR(j,MX2) {
      if(j < req) {
	dp[i][j] = 0;
	continue;
      }
      int lo = max((ll)0, j - c[i - 1]);
      dp[i][j] = (pref[j + 1] - pref[lo] + MOD) % MOD;
    }
    curr += b[i - 1];
  }

  ll ans = 0;
  FOR(j,MX2) {
    ans = (ans + dp[n][j]) % MOD;
  }
  return ans;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

  memset(dp, 0, sizeof dp);

  cin >> n;
  FOR(i,n) cin >> c[i];
  FOR(i,n-1) cin >> b[i];

  ll y = 0;
  ll curr = 0;
  FOR(i,n-1) {
    curr += b[i];
    y += curr;
  }

  int xbig = (n * MX - y)/n + 1;
  int xsmall = xbig;
  while(n * xsmall + y >= 0) xsmall--;

  map<int,int> ans;
  for(int x = xsmall + 1; x < xbig; x++) {
    ans[x] = solve(x);
  }

  int anssmall = 1;
  FOR(i,n) {
    anssmall = (1ll * anssmall * (c[i] + 1)) % MOD;
  }

  int q;
  cin >> q;

  FOR(i,q) {
    int x;
    cin >> x;
    if(x <= xsmall) cout << anssmall << '\n';
    else if(x >= xbig) cout << "0\n";
    else cout << ans[x] << '\n';
  }
}

// UPDATE N WHEN UR DONE AAAAAAAAAAAAAAAAAAAAAAAAAAA (if it applies lol)
