#include <bits/stdc++.h>
using namespace std;
set<pair<long long, long long> >::iterator h[10];
set<pair<long long, long long> > v;
long long len[300005];
long long nt[300005];
long long pt[300005];
long long q[300005];
long long g, r, T;
int n, m;
inline long long mod(long long x) {
  if (x < 0) x += (1 - x / T) * T;
  return x % T;
}
void calc(long long l, long long r, long long x) {
  pair<long long, long long> t;
  t = make_pair(l, -5);
  h[1] = v.lower_bound(t);
  h[2] = h[1];
  while (h[2] != v.end() && (*h[2]).first <= r) {
    nt[(*h[2]).second] = x;
    ++h[2];
  }
  v.erase(h[1], h[2]);
}
void work() {
  long long t1, t2, ans;
  int i;
  for (i = 1; i <= m; ++i) v.insert(make_pair(q[i] % T, n + i + 1));
  for (i = 0; i <= n + m + 1; ++i) nt[i] = n + 1;
  for (i = 1; i <= n + 1; ++i) {
    t1 = mod(g - len[i]);
    t2 = mod(T - len[i] - 1);
    if (t1 <= t2)
      calc(t1, t2, i);
    else
      calc(t1, T - 1, i);
    if (t1 > t2) calc(0, t2, i);
    v.insert(make_pair(mod(T - len[i]), i));
  }
  for (i = n; i > 0; --i) {
    pt[i] = pt[nt[i]];
    if (nt[i] != n + 1)
      pt[i] += ((len[nt[i]] - len[i]) / T + 1) * T;
    else
      pt[i] += len[nt[i]] - len[i];
  }
  for (i = 1; i <= m; ++i) {
    if (nt[n + i + 1] != n + 1)
      ans = ((q[i] + len[nt[n + i + 1]]) / T + 1) * T;
    else
      ans = q[i] + len[nt[n + i + 1]];
    ans += pt[nt[n + i + 1]];
    printf("%I64d\n", ans);
  }
}
int main() {
  int i;
  scanf("%d%I64d%I64d", &n, &g, &r);
  T = g + r;
  for (i = 1; i <= n + 1; ++i) {
    scanf("%I64d", &len[i]);
    len[i] += len[i - 1];
  }
  scanf("%d", &m);
  for (i = 1; i <= m; ++i) scanf("%I64d", &q[i]);
  work();
  return 0;
}
