#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
set<pair<int, int> > S;
int n, A, B, C, q, x, fa[N], L[N];
long long ans[N];
void Del(int l, int r, int id, int R) {
  set<pair<int, int> >::iterator iter = S.lower_bound(make_pair(l, 0));
  while (iter != S.end() && (*iter).first <= r) {
    ans[(*iter).second] += (R - (*iter).first + C) % C;
    fa[(*iter).second] = id;
    S.erase(iter);
    iter = S.lower_bound(make_pair(l, 0));
  }
}
int main() {
  scanf("%d%d%d", &n, &A, &B);
  for (int i = 1; i <= n + 1; i++) scanf("%d", &L[i]);
  C = A + B;
  int l = A, r = 0;
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d", &x);
    ans[i] = x;
    x %= C;
    S.insert(make_pair(x, i));
  }
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    x = L[i];
    (l -= x) %= C;
    (l += C) %= C;
    (r -= x) %= C;
    (r += C) %= C;
    sum += x;
    if (l <= r)
      Del(l, r, i + q, r);
    else
      Del(l, C - 1, i + q, r), Del(0, r, i + q, r);
    S.insert(make_pair(r, i + q));
  }
  x = L[n + 1];
  sum += x;
  for (int i = n + q; i > 0; i--)
    if (fa[i]) ans[i] += ans[fa[i]];
  for (int i = 1; i <= q; i++) printf("%lld\n", ans[i] + sum);
}
