#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
struct Lt {
  int x, lx, rx;
} Q[N * 30 + 3];
long long d[N + 3], f[N + 3];
int n, m, Lx, Rx, G, R, Mt, root, Qn;
void Edit(int &w, int l, int r, int x, int y) {
  if (!w) w = ++Qn;
  Q[w].x = y;
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (x <= mid)
    Edit(Q[w].lx, l, mid, x, y);
  else
    Edit(Q[w].rx, mid + 1, r, x, y);
}
int get(int w, int l, int r) {
  if (!w || l > Rx || r < Lx) return n + 1;
  if (Lx <= l && r <= Rx) return Q[w].x;
  int mid = (l + r) >> 1;
  return min(get(Q[w].lx, l, mid), get(Q[w].rx, mid + 1, r));
}
int Get(int t) {
  Lx = (G + t) % Mt, Rx = (Mt - 1 + t) % Mt;
  if (Lx <= Rx) return get(root, 0, Mt - 1);
  int ll = Lx, rr = Rx;
  Lx = 0, Rx = rr;
  int w1 = get(root, 0, Mt - 1);
  Lx = ll;
  Rx = Mt - 1;
  int w2 = get(root, 0, Mt - 1);
  return min(w1, w2);
}
int main() {
  scanf("%d%d%d", &n, &G, &R);
  Mt = G + R;
  for (int i = 1; i <= n + 1; i++) {
    scanf("%I64d", &d[i]);
    d[i] += d[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    int w = Get(d[i] % Mt);
    f[i] = f[w] + d[w] - d[i] + (Mt - (d[w] - d[i]) % Mt) * (w <= n);
    Edit(root, 0, Mt - 1, d[i] % Mt, i);
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    int w = Get(-x % Mt + Mt);
    printf("%I64d\n", d[w] + f[w] + x + (Mt - (d[w] + x) % Mt) * (w <= n));
  }
}
