#include <bits/stdc++.h>
using namespace std;
const int mo = 1e9 + 7;
int n, f[205][205 * 205], sum[205][205 * 205];
int b[205], c[205], q, xx, ans[1005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (int i = 1; i < n; i++) scanf("%d", &b[i]);
  f[0][0] = 1;
  for (int x = -302; x <= 302; x++) {
    for (int i = 0; i <= n * 100; i++) sum[0][i] = 1;
    for (int i = 1; i <= n; i++) {
      int t = i * x;
      for (int j = 1; j < i; j++) t += b[j] * (i - j);
      for (int j = 0; j < t; j++) sum[i][j] = 0;
      for (int j = max(0, t); j <= n * 100; j++) {
        f[i][j] = sum[i - 1][j];
        if (c[i] < j) f[i][j] = (f[i][j] - sum[i - 1][j - c[i] - 1] + mo) % mo;
        sum[i][j] = (sum[i][j - 1] + f[i][j]) % mo;
        if (i == n) ans[302 + x] = (ans[302 + x] + f[i][j]) % mo;
      }
    }
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d", &xx);
    xx += 302;
    xx = max(xx, 0);
    xx = min(xx, 604);
    printf("%d\n", ans[xx]);
  }
  return 0;
}
