#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmax(T& a, const T& b) {
  return a < b ? (a = b, true) : false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  return b < a ? (a = b, true) : false;
}
long long N, E, T;
long long dp1[100001];
long long dp2[100001];
const long long INF = 1e17;
int main() {
  scanf("%lld%lld%lld", &N, &E, &T);
  vector<long long> X(N + 1);
  for (int i = 1; i <= N; i++) {
    scanf("%lld", &X[i]);
  }
  fill_n(dp1, N + 1, INF);
  fill_n(dp2, N + 1, INF);
  dp1[0] = 0;
  int j = 1;
  for (int i = 1; i <= N; i++) {
    while (j < i && (X[i] - X[j]) * 2 > T) j++;
    printf("%d %d\n", i, j);
    chmin(dp1[i], dp1[j - 1] + T);
    chmin(dp1[i], dp2[j - 1] + X[i] * 2);
    chmin(dp2[i], min(dp2[i - 1], dp1[i - 1] - X[i] * 2));
  }
  printf("%lld\n", dp1[N] + E);
  return 0;
}
