#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const long long MOD = 1e9 + 7;
int N, Q;
long long C[110], CS[110];
long long B[110];
long long T[110];
long long X[100100];
long long D[110][10100];
long long solve(long long X) {
  D[0][0] = 1;
  long long base = 0;
  for (int i = 0; i < N; i++) {
    for (long long j = max(-base, 0LL); j <= CS[i]; j++) {
      for (int k = 0; k <= C[i + 1]; k++) {
        D[i + 1][j + k] = (D[i + 1][j + k] + D[i][j]) % MOD;
      }
    }
    base -= T[i] + X;
  }
  long long ans = 0;
  for (long long j = max(-base, 0LL); j <= CS[N]; j++) ans += D[N][j];
  return ans;
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%lld", &C[i]);
  for (int i = 1; i <= N; i++) CS[i] = CS[i - 1] + C[i];
  for (int i = 1; i <= N - 1; i++) scanf("%lld", &B[i]);
  for (int i = 1; i <= N - 1; i++) T[i] = T[i - 1] + B[i];
  scanf("%d", &Q);
  for (int i = 0; i < Q; i++) scanf("%lld", &X[i]);
  for (int i = 0; i < Q; i++) {
    printf("%lld\n", solve(X[i]));
  }
  return 0;
}
