#include <bits/stdc++.h>
using namespace std;
struct chtholly {
  long long l, r;
  mutable int v;
  chtholly(long long L, long long R = -1, int V = 0) : l(L), r(R), v(V) {}
  bool operator<(const chtholly& x) const { return x.l > l; }
};
set<chtholly> s;
set<chtholly>::iterator split(long long pos) {
  set<chtholly>::iterator it = s.lower_bound(chtholly(pos));
  if (it != s.end() && (it->l == pos)) return it;
  --it;
  long long L = it->l, R = it->r;
  int V = it->v;
  s.erase(it);
  s.insert(chtholly(L, pos - 1, V));
  return s.insert(chtholly(pos, R, V)).first;
}
void assign_val(long long l, long long r, int val) {
  set<chtholly>::iterator itl = split(l), itr = split(r + 1);
  s.erase(itl, itr);
  s.insert(chtholly(l, r, val));
}
long long f[100000 + 5], sum[100000 + 5];
int l[100000 + 5];
int main() {
  int n, g, r, i, j;
  long long m;
  scanf("%d%d%d", &n, &g, &r);
  m = g + r;
  s.insert(chtholly(0, m - 1, n + 1));
  s.insert(chtholly(m, m, 0));
  for (i = 1; i <= n + 1; i++) scanf("%d", &l[i]);
  sum[0] = 0;
  for (i = 1; i <= n + 1; i++) sum[i] = sum[i - 1] + l[i];
  for (i = n; i >= 1; i--) {
    long long t = -sum[i];
    int ans = split((t % m + m) % m)->v;
    if (ans == n + 1)
      f[i] = sum[n + 1] - sum[i];
    else
      f[i] = sum[ans] - sum[i] + f[ans] - (sum[ans] - sum[i]) % m + m;
    long long ll = ((g - sum[i]) % m + m) % m,
              rr = ((m - 1 - sum[i]) % m + m) % m;
    if (ll <= rr)
      assign_val(ll, rr, i);
    else
      assign_val(0, rr, i), assign_val(ll, m - 1, i);
  }
  int q;
  scanf("%d", &q);
  for (i = 1; i <= q; i++) {
    long long t;
    scanf("%lld", &t);
    int ans = split((t % m + m) % m)->v;
    if (ans == n + 1)
      printf("%lld\n", t + sum[n + 1]);
    else
      printf("%lld\n", t + sum[ans] + f[ans] - (sum[ans] + t) % m + m);
  }
}
