#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
struct node {
  node* left;
  node* right;
  int data;
  node(int dat = INF) {
    left = right = NULL;
    data = dat;
  }
};
int getdata(node* v) { return v == NULL ? INF : v->data; }
void Nmodify(node*& v, int id, int cur, int cl = 0, int cr = 1073741823) {
  if (v == NULL) v = new node(cur);
  if (cl != cr) {
    int mid = (cl + cr) >> 1;
    if (id <= mid)
      Nmodify(v->left, id, cur, cl, mid);
    else
      Nmodify(v->right, id, cur, mid + 1, cr);
    v->data = min(getdata(v->left), getdata(v->right));
  } else
    v->data = min(v->data, cur);
}
int Nquery(node*& v, int l, int r, int cl = 0, int cr = 1073741823) {
  if (v == NULL) return INF;
  if (l == cl && r == cr) return v->data;
  int ans = INF;
  int mid = (cl + cr) >> 1;
  if (l <= mid) ans = min(ans, Nquery(v->left, l, min(r, mid), cl, mid));
  if (r > mid)
    ans = min(ans, Nquery(v->right, max(l, mid + 1), r, mid + 1, cr));
  return ans;
}
int n, g, r;
int query(node*& v, long long cl, long long cr) {
  cl %= g + r;
  cr %= g + r;
  if (cl < 0) cl += g + r;
  if (cr < 0) cr += g + r;
  if (cl <= cr)
    return Nquery(v, cl, cr);
  else
    return min(Nquery(v, 0, cr), Nquery(v, cl, g + r - 1));
}
node* tre;
long long nd[100005];
int nxt[100005][20];
long long dist[100005][20];
int main() {
  scanf("%d%d%d", &n, &g, &r);
  for (int k = 1; k <= (n + 1); k++) scanf("%I64d", &nd[k]);
  for (int k = 1; k <= (n + 1); k++) nd[k] += nd[k - 1];
  for (int k = n; k >= 0; k--) {
    if (k) Nmodify(tre, nd[k] % (g + r), k);
    nxt[k][0] = min(n + 1, query(tre, nd[k] + g, nd[k] + g + r - 1));
    dist[k][0] = nd[nxt[k][0]] - nd[k];
    if (nxt[k][0] <= n) dist[k][0] += g + r - dist[k][0] % (g + r);
  }
  nxt[n + 1][0] = n + 1;
  dist[n + 1][0] = 0;
  for (int j = 1; j <= (16); j++)
    for (int i = 0; i < (n + 2); i++) {
      nxt[i][j] = nxt[nxt[i][j - 1]][j - 1];
      dist[i][j] = dist[i][j - 1] + dist[nxt[i][j - 1]][j - 1];
    }
  int q, x;
  scanf("%d", &q);
  for (int k = 0; k < (q); k++) {
    scanf("%d", &x);
    int np = min(n + 1, query(tre, g - x, g + r - x - 1));
    long long cd = nd[np] + x;
    if (np == n + 1)
      printf("%I64d\n", cd);
    else {
      cd += g + r - cd % (g + r);
      for (int k = 16; k >= 0; k--)
        if (nxt[np][k] != n + 1) {
          cd += dist[np][k];
          np = nxt[np][k];
        }
      cd += dist[np][0];
      printf("%I64d\n", cd);
    }
  }
  return 0;
}
