#include <bits/stdc++.h>
using namespace std;
int n, a[100000 + 5], ans, cnt = 0;
long long f[100000 + 5], sum[100000 + 5];
struct node {
  int lson, rson, l, r, val;
} T[4000000 + 5];
void modify(int id, int pos, int s) {
  T[pos].val = s;
  if (T[pos].l >= id && T[pos].r <= id) return;
  int mid = (T[pos].l + T[pos].r) / 2;
  if (id <= mid) {
    if (T[pos].lson == 0) {
      T[pos].lson = ++cnt;
      T[cnt].l = T[pos].l;
      T[cnt].r = mid;
    }
    modify(id, T[pos].lson, s);
  }
  if (id > mid) {
    if (T[pos].rson == 0) {
      T[pos].rson = ++cnt;
      T[cnt].l = mid + 1;
      T[cnt].r = T[pos].r;
    }
    modify(id, T[pos].rson, s);
  }
}
void query(int Left, int Right, int pos) {
  if (T[pos].l >= Left && T[pos].r <= Right) {
    ans = min(ans, T[pos].val);
    return;
  }
  int mid = (T[pos].l + T[pos].r) / 2;
  if (Left <= mid && T[pos].lson != 0) query(Left, Right, T[pos].lson);
  if (Right > mid && T[pos].rson != 0) query(Left, Right, T[pos].rson);
}
int main() {
  int g, r, i, j, m;
  scanf("%d%d%d", &n, &g, &r);
  m = g + r;
  for (i = 1; i <= n + 1; i++) scanf("%d", &a[i]);
  sum[0] = 0;
  for (i = 1; i <= n + 1; i++) sum[i] = sum[i - 1] + a[i];
  memset(T, 0, sizeof(T));
  cnt = 1;
  T[cnt].l = 0;
  T[cnt].r = m - 1;
  T[cnt].val = n + 1;
  f[n + 1] = 0;
  for (i = n; i >= 1; i--) {
    ans = n + 1;
    int t = ((-sum[i]) % m + m) % m;
    if (t <= g)
      query(g - t, m - t - 1, 1);
    else {
      if (m - t - 1 >= 0) query(0, m - t - 1, 1);
      if (m + g - t <= m - 1) query(m + g - t, m - 1, 1);
    }
    if (ans == n + 1)
      f[i] = sum[n + 1] - sum[i];
    else
      f[i] = sum[ans] - sum[i] + f[ans] - (sum[ans] - sum[i]) % m + m;
    modify(sum[i] % m, 1, i);
  }
  int q;
  scanf("%d", &q);
  for (i = 1; i <= q; i++) {
    long long t, tt;
    scanf("%lld", &t);
    tt = t;
    t %= m;
    ans = n + 1;
    if (t <= g)
      query(g - t, m - t - 1, 1);
    else {
      if (m - t - 1 >= 0) query(0, m - t - 1, 1);
      if (m + g - t <= m - 1) query(m + g - t, m - 1, 1);
    }
    if (ans == n + 1) {
      printf("%lld\n", sum[n + 1] + tt);
      continue;
    }
    printf("%lld\n", (tt + sum[ans]) - (tt + sum[ans]) % m + m + f[ans]);
  }
}
