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

int main() {
  int N,H,W;
  cin>>N>>H>>W;
  if(N==1){
    int a;
    cin>>a;
    cout<<abs(W-a)<<endl;
  }
  else{
    for(int i=0;i<N-2;i++){
      int a;
      cin>>a;
    }
    int b,c;
    cin>>b>>c;
    cout<<max(abs(W-c),abs(b-c))<<endl;
  }
}