#include <bits/stdc++.h>
using namespace std;
int n, q;
long long g, r, t, l[100100], le, ri, dp[100100], pp;
set<pair<int, int> > mp;
set<pair<int, int> >::iterator it1, it2;
long long Norm(long long x) { return ((x % t) + t) % t; }
void ins(int i, int le, int ri) {
  it1 = mp.lower_bound(make_pair(le, 0));
  it2 = mp.upper_bound(make_pair(ri + 1, 0));
  int j = (--it2)->second;
  mp.erase(it1, ++it2);
  mp.insert(make_pair(le, i));
  mp.insert(make_pair(ri, j));
}
long long Bus(int i, long long tim) {
  tim = Norm(tim);
  it1 = --mp.upper_bound(make_pair(tim + 1, 0));
  int j = it1->second;
  return l[j] - l[i] + (j == n + 1 ? 0 : t - Norm(tim + l[j]) + dp[j]);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> g >> r;
  t = g + r;
  for (int i = 1; i <= n + 1; i++) {
    cin >> l[i];
    l[i] += l[i - 1];
  }
  mp.insert(make_pair(0, n + 1));
  for (int i = n; i >= 1; i--) {
    le = Norm(g - l[i]);
    ri = Norm(-l[i]);
    dp[i] = Bus(i, -l[i]);
    le < ri ? ins(i, le, ri) : (ins(i, le, t), ins(i, 0, ri));
  }
  cin >> q;
  while (q--) {
    cin >> pp;
    cout << pp + Bus(0, pp) << endl;
  }
  return 0;
}
