#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 2, N = int(1e5) + 10;
struct node {
  node *lc, *rc;
  int mv;
  node(int v) : mv(v) { lc = rc = 0; }
};
void insert(node *&t, int p, int v, int l, int r) {
  if (!t) t = new node(v);
  t->mv = min(t->mv, v);
  if (l == r) return;
  int m = (l + r) / 2;
  if (p <= m)
    insert(t->lc, p, v, l, m);
  else
    insert(t->rc, p, v, m + 1, r);
}
int query(node *t, int ql, int qr, int l, int r) {
  if (!t) return inf;
  if (ql <= l && r <= qr) return t->mv;
  int m = (l + r) / 2, res(inf);
  if (ql <= m) res = min(res, query(t->lc, ql, qr, l, m));
  if (qr > m) res = min(res, query(t->rc, ql, qr, m + 1, r));
  return res;
}
node *rt;
long long sumdis[N], trest[N], G, R, T;
int n;
long long solve(int p, int ti) {
  long long r = ((sumdis[p] - ti) % T + T) % T, l = (r + G) % T;
  int q;
  if (l <= r)
    q = query(rt, l, r, 0, T - 1);
  else
    q = min(query(rt, l, T - 1, 0, T - 1), query(rt, 0, r, 0, T - 1));
  if (q > n) return sumdis[n + 1] - sumdis[p];
  return trest[q] + sumdis[q] - sumdis[p] + ((r - sumdis[q]) % T + T) % T;
}
int main() {
  scanf("%d%I64d%I64d", &n, &G, &R);
  T = G + R;
  for (int i = 1; i <= n + 1; ++i) {
    scanf("%I64d", sumdis + i);
    sumdis[i] += sumdis[i - 1];
  }
  for (int i = n; i >= 0; --i) {
    trest[i] = solve(i, 0);
    if (i) insert(rt, sumdis[i] % T, i, 0, T - 1);
  }
  int q, t;
  scanf("%d", &q);
  while (q--) {
    scanf("%d", &t);
    printf("%I64d\n", t + solve(0, t));
  }
  return 0;
}
