#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N, E, T;
  cin >> N >> E >> T;
  long long kuma[100000];
  long long edge[100000];
  for (long long i = 0; i < N; i++) cin >> kuma[i];
  for (long long i = 0; i < N - 1; i++) edge[i] = kuma[i + 1] - kuma[i];
  long long sum = kuma[0];
  long long ruiseki = 0;
  for (long long i = 0; i < N - 1; i++) {
    if (max(max((long long)0, T - ruiseki * 2), ruiseki) + ruiseki + edge[i] +
            T >
        (max(max((long long)0, T - (ruiseki * 2 + 2 * edge[i])),
             ruiseki + 2 * edge[i])) +
            ruiseki + edge[i]) {
      ruiseki += edge[i];
      sum += edge[i];
    } else {
      sum +=
          max(max((long long)0, T - ruiseki * 2), ruiseki) + ruiseki + edge[i];
      cout << ruiseki << endl;
      ruiseki = 0;
    }
    cout << sum << " " << ruiseki << endl;
  }
  if (ruiseki) {
    cout << sum + E - kuma[N - 1] +
                max(max((long long)0, T - ruiseki * 2), ruiseki) + ruiseki
         << endl;
  } else {
    cout << sum + E - kuma[N - 1] + T << endl;
  }
  return 0;
}
