#include <bits/stdc++.h>
using namespace std;
map<int, int> interval;
int n;
long long g, r, sum;
long long l[101010], t[101010];
void addInterval(int i, int l, int r) {
  map<int, int>::iterator st = interval.lower_bound(l),
                          ed = interval.upper_bound(r);
  int tmp = (--ed)->second;
  interval.erase(st, ++ed);
  interval[l] = i;
  interval[r] = tmp;
}
long long getT(int i, long long x) {
  int j = (--interval.upper_bound((((x) % sum + sum) % sum)))->second;
  return l[j] - l[i] +
         (j == n + 1 ? 0 : sum - (((x + l[j]) % sum + sum) % sum) + t[j]);
}
int main() {
  scanf("%d %I64d %I64d", &n, &g, &r);
  sum = g + r;
  for (int i = 1; i <= n + 1; i++) {
    scanf("%I64d", &l[i]);
    l[i] += l[i - 1];
  }
  interval[0] = n + 1;
  for (int i = n; i; i--) {
    long long L = (((g - l[i]) % sum + sum) % sum),
              R = (((-l[i]) % sum + sum) % sum);
    t[i] = getT(i, R);
    if (L < R)
      addInterval(i, L, R);
    else {
      addInterval(i, L, sum);
      addInterval(i, 0, R);
    }
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int x;
    scanf("%d", &x);
    printf("%I64d\n", x + getT(0, x));
  }
  return 0;
}
