#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif //_MSC_VER

#include <cstdio>

#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <numeric>
#include <ctime>
#include <chrono>
#include <iostream>
#include <string>
#include <sstream>
#include <array>
#include <random>
#include <cmath>
#include <cassert>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <utility>
#include <thread>

using std::cin;
using std::cout;
using std::string;
using std::vector;

using ll = long long;

constexpr int MOD = 1000000000 + 7;  
constexpr int N = 117;
int b[N], c[N], f[2][2 * N * N], ans[N * 2];

static int solve(int testcase)
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i)cin >> c[i];
	for (int i = 1; i <= n - 1; ++i)cin >> b[i];

	int mn = INT_MAX;
	for (int i = 1; i <= n; ++i) {
		int sum = 0;
		for (int j = 0; j < i; ++j) {
			for (int k = 1; k <= j; ++k) {
				sum += b[k];
			}

		}

		mn = std::min(mn, -sum/i);
	}

	int mx = mn + 150;
	mn = mn - 45;

	memset(ans, -1, sizeof(ans));

	int q;
	cin >> q;
	for (int iq = 1; iq <= q; ++iq)
	{
		int x;
		cin >> x;
		x = std::min(mx, std::max(x, mn));

		if (ans[x - mn] != -1)
		{
			cout << ans[x - mn] << '\n';
			continue;
		}

		int res = 0;
		int delta = 0, sum = 0, sb = 0;
		int cur = 1, nxt = 0;
		memset(f, 0, sizeof(f));
		f[cur][0] = 1;

		for (int i = 1; i <= n; ++i) {
			memset(f[nxt], 0, sizeof(f[nxt]));
			delta += sb;
			for (int j = 0; j <= sum; ++j) {
				int presum = x * i + delta - j;
				int bb = std::max(presum, 0);

				if (bb <= c[i]) {
					f[nxt][j + bb] += f[cur][j];
					f[nxt][j + c[i] + 1] += MOD - f[cur][j];
					if (f[nxt][j + bb] >= MOD)
						f[nxt][j + bb] -= MOD;
					if (f[nxt][j + c[i] + 1] >= MOD)
						f[nxt][j + c[i] + 1] -= MOD;
				}
			}

			sum += c[i];

			for (int j = 1; j <= sum; ++j) {
				f[nxt][j] += f[nxt][j - 1];
				if (f[nxt][j] >= MOD)
					f[nxt][j] -= MOD;
			}

			sb += b[i];
			std::swap(cur, nxt);
		}
		for (int i = 0; i <= sum; ++i)
		{
			res += f[cur][i];
			if (res >= MOD)
				res -= MOD;
		}
		ans[x - mn] = res;
		cout << res << '\n';

	}

	return 0;
}

int main(int argc, char* argv[])
{
 
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif //ONLINE_JUDGE
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::cout.tie(0);
	
	int tc = 1;
	//std::cin >> tc;
	for (int ic = 1; ic <= tc; ++ic)
	{
		solve(ic);
	}

	return 0;
}
