#include <bits/stdc++.h>
using namespace std;

int main() {
   int N, X, Y;
   cin >> N >> X >> Y;
   vector<int> v(N);
   for (int i = 0; i < N; i++) cin >> v[i];

   if (N >= 2) {
      cout << max( abs(v[N-1]-Y), abs(v[N-2]-v[N-1]) ) << endl;
   } else {
      cout << abs(v[0] - Y) << endl;
   }

   return 0;
}