#include <bits/stdc++.h>
using namespace std;
const int n = 100005;
int N, i, l, r, st, ed, Q, Pos;
long long G, R, t, ti, Ans, *St, *Ed;
int P[n], Id[n], f[4 * n];
long long L[n], pre[n], len[n], T[n];
void read(int &x) {
  char ch;
  x = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; x = x * 10 + ch - 48, ch = getchar())
    ;
}
void readll(long long &x) {
  char ch;
  x = 0;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; x = x * 10 + ch - 48, ch = getchar())
    ;
}
int cmp(const int &i, const int &j) { return pre[i] < pre[j]; }
long long Reach(long long l, long long r) {
  return ((r - l) / (G + R) + 1) * (G + R);
}
void Build(int t, int l, int r) {
  int mid = (l + r) / 2;
  if (l == r) {
    f[t] = N + 1;
    return;
  }
  Build(2 * t, l, mid), Build(2 * t + 1, mid + 1, r);
  f[t] = min(f[2 * t], f[2 * t + 1]);
}
void Modify(int t, int l, int r, int x, int y) {
  int mid = (l + r) / 2;
  if (l == r) {
    f[t] = y;
    return;
  }
  if (x <= mid)
    Modify(2 * t, l, mid, x, y);
  else
    Modify(2 * t + 1, mid + 1, r, x, y);
  f[t] = min(f[2 * t], f[2 * t + 1]);
}
int Query(int t, int l, int r, int ll, int rr) {
  int mid = (l + r) / 2;
  if (ll > rr) return N + 1;
  if (l == ll && r == rr) return f[t];
  if (rr <= mid) return Query(2 * t, l, mid, ll, rr);
  if (ll > mid) return Query(2 * t + 1, mid + 1, r, ll, rr);
  return min(Query(2 * t, l, mid, ll, mid),
             Query(2 * t + 1, mid + 1, r, mid + 1, rr));
}
int main() {
  read(N), readll(G), readll(R);
  ++N;
  for (i = 1; i <= N; ++i) readll(L[i]);
  for (i = 1; i <= N; ++i) L[i] += L[i - 1];
  for (i = 0; i <= N; ++i) pre[i] = L[i] % (G + R);
  for (i = 0; i <= N; ++i) P[i] = i;
  sort(P, P + N + 1, cmp);
  for (i = 0; i <= N; ++i) len[i] = pre[P[i]], Id[P[i]] = i;
  T[N] = 0, Build(1, 0, N);
  for (i = N - 1; i >= 0; --i) {
    Modify(1, 0, N, Id[i + 1], i + 1);
    l = (pre[i] + G) % (G + R), r = (pre[i] + G + R - 1) % (G + R);
    St = lower_bound(len, len + N + 1, l);
    Ed = upper_bound(len, len + N + 1, r) - 1;
    st = St - len, ed = Ed - len;
    if (l <= r)
      Pos = Query(1, 0, N, st, ed);
    else
      Pos = min(Query(1, 0, N, 0, ed), Query(1, 0, N, st, N));
    if (Pos >= N)
      T[i] = L[N] - L[i];
    else
      T[i] = Reach(L[i], L[Pos]) + T[Pos];
  }
  read(Q);
  for (i = 1; i <= Q; ++i) {
    readll(ti);
    t = (G + R - ti % (G + R)) % (G + R);
    l = (t + G) % (G + R), r = (t + G + R - 1) % (G + R);
    St = lower_bound(len, len + N + 1, l);
    Ed = upper_bound(len, len + N + 1, r) - 1;
    st = St - len, ed = Ed - len;
    if (l <= r)
      Pos = Query(1, 0, N, st, ed);
    else
      Pos = min(Query(1, 0, N, 0, ed), Query(1, 0, N, st, N));
    if (Pos >= N)
      Ans = L[N] + ti;
    else
      Ans = Reach(-ti, L[Pos]) + T[Pos];
    printf("%I64d\n", Ans);
  }
  return 0;
}
