#include <bits/stdc++.h>
using namespace std;
struct node {
  int v;
  node *l, *r;
  node() : v(2000000000), l(), r() {}
};
void update(node *rt, int id, int v) {
  int il = 0, ir = 1073741824;
  for (;;) {
    rt->v = min(rt->v, v);
    if (ir == il + 1) break;
    int mid = (il + ir) / 2;
    if (id >= mid) {
      if (!rt->r) rt->r = new node;
      rt = rt->r;
      il = mid;
    } else {
      if (!rt->l) rt->l = new node;
      rt = rt->l;
      ir = mid;
    }
  }
}
int query(node *rt, int il, int ir, int l, int r) {
  if (!rt) return 2000000000;
  if (il >= l && ir <= r) return rt->v;
  if ((l >= il && l < ir) || (r > il && r <= ir))
    return min(query(rt->l, il, (il + ir) >> 1, l, r),
               query(rt->r, (il + ir) >> 1, ir, l, r));
  return 2000000000;
}
long long dist[100002], dp[100002];
int main() {
  int n, g, r;
  scanf("%d%d%d", &n, &g, &r);
  node *rt = new node;
  ++n;
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", dist + i);
    dist[i] += dist[i - 1];
  }
  for (int i = n - 1; i >= 1; --i) {
    int ql = (dist[i] + g) % (g + r);
    int qr = dist[i] % (g + r);
    int nxt;
    if (ql < qr)
      nxt = query(rt, 0, 1073741824, ql, qr);
    else
      nxt = min(query(rt, 0, 1073741824, ql, g + r),
                query(rt, 0, 1073741824, 0, qr));
    if (nxt == 2000000000)
      dp[i] = 0;
    else
      dp[i] = dp[nxt] + g + r - (dist[nxt] - dist[i]) % (g + r);
    update(rt, dist[i] % (g + r), i);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int t;
    scanf("%d", &t);
    int ql = (g - t) % (g + r), qr = (g + r - t) % (g + r);
    if (ql < 0) ql += g + r;
    if (qr < 0) qr += g + r;
    int nxt;
    if (ql < qr)
      nxt = query(rt, 0, 1073741824, ql, qr);
    else
      nxt = min(query(rt, 0, 1073741824, ql, g + r),
                query(rt, 0, 1073741824, 0, qr));
    long long ans = dist[n] + t;
    if (nxt != 2000000000) ans += dp[nxt] + g + r - (dist[nxt] + t) % (g + r);
    printf("%lld\n", ans);
  }
  return 0;
}
