#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
map<int, int> a;
int n;
long long g, r, s, l[N], t[N];
void ins(int i, int l, int r) {
  map<int, int>::iterator beg = a.lower_bound(l), end = a.upper_bound(r);
  int tmp = (--end)->second;
  a.erase(beg, ++end);
  a[l] = i;
  a[r] = tmp;
}
long long tim(int i, long long x) {
  int j = (--a.upper_bound((((x) % s + s) % s)))->second;
  return l[j] - l[i] + (j == n + 1 ? 0 : s - (((x + l[j]) % s + s) % s) + t[j]);
}
int main() {
  scanf("%d%I64d%I64d", &n, &g, &r);
  s = g + r;
  for (int i = 1; i <= n + 1; i++) scanf("%I64d", l + i), l[i] += l[i - 1];
  a[0] = n + 1;
  for (int i = n; i; i--) {
    long long L = (((g - l[i]) % s + s) % s), R = (((-l[i]) % s + s) % s);
    t[i] = tim(i, R);
    if (L < R)
      ins(i, L, R);
    else
      ins(i, L, s), ins(i, 0, R);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int x;
    scanf("%d", &x);
    printf("%I64d\n", x + tim(0, x));
  }
}
