#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100005;
struct node {
  long long size = 1 << 30, ls, rs;
} t[maxn * 100];
long long n, q, g, r, tot, rt;
long long l[maxn], d[maxn], f[maxn];
void update(long long id) {
  t[id].size = min(t[t[id].ls].size, t[t[id].rs].size);
}
void add(long long l, long long r, long long &id, long long pos,
         long long val) {
  if (!id) id = ++tot;
  if (l == r) {
    t[id].size = min(t[id].size, val);
    return;
  }
  long long mid = (l + r) >> 1;
  if (mid >= pos)
    add(l, mid, t[id].ls, pos, val);
  else
    add(mid + 1, r, t[id].rs, pos, val);
  update(id);
}
long long query(long long l, long long r, long long id, long long L,
                long long R) {
  if (!id) return 1 << 30;
  if (L <= l and r <= R) {
    return t[id].size;
  }
  long long ans = 1 << 30;
  long long mid = (l + r) >> 1;
  if (mid >= L) ans = min(ans, query(l, mid, t[id].ls, L, R));
  if (mid < R) ans = min(ans, query(mid + 1, r, t[id].rs, L, R));
  return ans;
}
signed main() {
  cin >> n >> g >> r;
  for (long long i = 1; i <= n + 1; i++) {
    cin >> l[i];
    d[i] = d[i - 1] + l[i];
  }
  f[n] = l[n + 1];
  add(0, g + r - 1, rt, d[n + 1] % (g + r), n + 1);
  add(0, g + r - 1, rt, d[n] % (g + r), n);
  for (signed i = n - 1; i > 0; --i) {
    long long L = ((g + d[i]) % (g + r) + (g + r)) % (g + r),
              R = ((g + r - 1 + d[i]) % (g + r) + (g + r)) % (g + r), ans;
    if (L > R) {
      ans = min(query(0, g + r - 1, rt, 0, R),
                query(0, g + r - 1, rt, L, g + r - 1));
    } else {
      ans = query(0, g + r - 1, rt, L, R);
    }
    if (ans == 1 << 30) ans = n + 1;
    if (ans != n + 1)
      f[i] = ceil((d[ans] - d[i]) * 1.0 / (g + r)) * (g + r) + f[ans];
    else
      f[i] = d[ans] - d[i];
    add(0, g + r - 1, rt, d[i] % (g + r), i);
  }
  cin >> q;
  while (q--) {
    long long t;
    cin >> t;
    long long L = ((g - t) % (g + r) + (g + r)) % (g + r),
              R = ((g + r - 1 - t) % (g + r) + (g + r)) % (g + r), ans;
    if (L > R) {
      ans = min(query(0, g + r - 1, rt, 0, R),
                query(0, g + r - 1, rt, L, g + r - 1));
    } else {
      ans = query(0, g + r - 1, rt, L, R);
    }
    if (ans == 1 << 30) ans = n + 1;
    if (ans != n + 1)
      cout << (long long)ceil((d[ans] + t) * 1.0 / (g + r)) * (g + r) + f[ans]
           << endl;
    else
      cout << d[ans] + t << endl;
  }
}
