#include <iostream>
using namespace std;

int main() {
int n,z,w,a[2000];
cin>>n>>z>>w;
for(int i=0;i<n;i++){
    cin>>a[i];
}
if(n==1){
    cout<<abs(w-a[0])<<endl;
}else{
    cout<<max(abs(a[n-1]-a[n-2]),abs(w-a[n-1]));
}
	return 0;
}