#include <bits/stdc++.h>
using namespace std;
long long q, n, g, r, a[101010], b[101010];
map<int, int> mp;
long long jian(long long x) {
  x = ((x % r) + r) % r;
  return x;
}
void gx(int xh, int l, int rr) {
  map<int, int>::iterator it1 = mp.lower_bound(l), it2 = mp.upper_bound(rr);
  it2--;
  int nw = it2->second;
  it2++;
  mp.erase(it1, it2);
  mp[l] = xh;
  mp[rr] = nw;
}
long long dr(int xh, long long x) {
  int nw = (--mp.upper_bound(jian(x)))->second;
  return a[nw] - a[xh] + (nw == n ? 0 : r - jian(x + a[nw]) + b[nw]);
}
int main() {
  cin >> n >> g >> r;
  n++;
  r += g;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  mp[0] = n;
  for (int i = n - 1; i >= 1; i--) {
    long long l = jian(g - a[i]), rr = jian(-a[i]);
    b[i] = dr(i, -a[i]);
    if (l < rr) {
      gx(i, l, rr);
    } else {
      gx(i, l, r);
      gx(i, 0, rr);
    }
  }
  cin >> q;
  while (q--) {
    long long x;
    cin >> x;
    cout << x + dr(0, x) << endl;
  }
  return 0;
}
