#include <bits/stdc++.h>
using namespace std;
long long int x[1000005], mn[1000005], dp[1000005];
deque<pair<long long int, long long int> > dq;
int main() {
  long long int i, j, k, l, n, m, e, t;
  scanf("%lld %lld %lld", &n, &e, &t);
  for (i = 1; i <= n; i++) scanf("%lld", &x[i]);
  x[0] = 0;
  x[n + 1] = e;
  dp[0] = 0;
  mn[0] = -x[0] - 2 * x[1] + dp[0];
  dq.push_front(make_pair(0, 0));
  long long int last = 0;
  for (i = 1; i <= n; i++) {
    while (last < i && 2 * (x[i] - x[last + 1]) > t) {
      if (!dq.empty() && dq.back().second == last) dq.pop_back();
      last++;
    }
    dp[i] = dp[i - 1] + x[i] - x[i - 1] + t;
    if (last > 0) dp[i] = min(dp[i], 3 * x[i] + mn[last - 1]);
    if (!dq.empty()) dp[i] = min(dp[i], x[i] + dq.back().first + t);
    mn[i] = min(mn[i - 1], dp[1] - x[1] - 2 * x[i + 1]);
    while (!dq.empty() && dq.front().first >= dp[i] - x[i]) dq.pop_front();
    dq.push_front(make_pair(dp[i] - x[i], i));
  }
  for (i = 1; i <= n; i++) printf("%lld\n", dp[i]);
  printf("%lld\n", dp[n] + x[n + 1] - x[n]);
  return 0;
}
