#include <bits/stdc++.h>

using namespace std;

const int N = 105, mod = 1e9+7, inf = 1e9;
typedef long long ll;

int n, q;
int b[N], c[N], sb[N];
ll prod = 1, f[N*N], s[N*N];
map<int, ll> mp;

inline void solve(int x) {
	for (int i = 0; i <= n * 100; i++) s[i] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= n * 100; j++) f[j] = 0;
		for (int j = max(0, i * x + sb[i]); j <= n * 100; j++)
			f[j] = (s[j] - (j - c[i] > 0 ? s[j-c[i]-1] : 0) + mod) % mod;
		s[0] = f[0];
		for (int j = 1; j <= n * 100; j++) s[j] = (s[j-1] + f[j]) % mod;
	}
	mp[x] = s[n*100];
}

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) 
		scanf("%d", &c[i]), prod = prod * (c[i] + 1) % mod;
	for (int i = 1; i < n; i++)
		scanf("%d", &b[i]);
	for (int i = 1; i <= n; i++) 
		for (int j = 1; j < i; j++)
			sb[i] += (i - j) * b[j];
	int L = inf, R = inf;
	for (int i = 2; i <= n; i++)
		L = min(L, -sb[i] / i), R = min(R, (100 * n - sb[i]) / i);
	for (int i = L; i <= R; i++) solve(i);
	scanf("%d", &q);
	for (int i = 1; i <= q; i++) {
		int x; scanf("%d", &x);
		if (x < L) printf("%lld\n", prod);
		else if (x > R) printf("0\n");
		else printf("%lld\n", mp[x]);
	}
	return 0;
}