#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp make_pair
#define pb push_back
#define mes(a,b) memset(a,b,sizeof(a))
#define mes0(a) memset(a,0,sizeof(a))
#define lson l,mid,pos<<1
#define rson mid+1,r,pos<<1|1
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define fi first
#define se second
#define sss(a) a::iterator
#define all(a) a.begin(),a.end()
#define READ_INTEGER \
{ \
    x=0;\
    int f=1;char ch=_getchar();\
    while((ch<'0'||ch>'9')&&~ch){if(ch=='-')f=-1;ch=_getchar();}\
    if (ch==-1)return -1;\
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=_getchar();}\
    x*=f;\
    return 1;\
}
#define READ_REAL \
{\
        char in;double Dec=0.1;\
        bool IsN=false,IsD=false;\
        in=_getchar();\
        if(in==EOF) return -1;\
        while(in!='-'&&in!='.'&&(in<'0'||in>'9'))\
                in=_getchar();\
        if(in=='-'){IsN=true;x=0;}\
        else if(in=='.'){IsD=true;x=0;}\
        else x=in-'0';\
        if(!IsD){\
                while(in=_getchar(),in>='0'&&in<='9'){\
                        x*=10;x+=in-'0';}\
        }\
        if(in!='.'){\
                if(IsN) x=-x;\
                return 1;\
        }else{\
                while(in=_getchar(),in>='0'&&in<='9'){\
                        x+=Dec*(in-'0');Dec*=0.1;\
                }\
        }\
        if(IsN) x=-x;\
        return 1;\
}
#define READ_STRING \
{\
    char *tmp=x;\
    char in=_getchar();\
    while(in<=' '&&in!=EOF)in=_getchar();\
    if (in==-1)return -1;\
    while (in>' ')*(tmp++)=in,in=_getchar();\
    *tmp='\0';\
    return 1;\
}
using namespace std;
typedef double DB;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<long long ,int> pli;
typedef pair<int,long long > pil;
typedef pair<string,int> psi;
typedef pair<long long ,long long > pll;

const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const double pi = acos(-1.0);
const int maxn = 100000+10;
const int mod = 1e9+7;

inline char _getchar()
{
    static const int BUFSIZE = 100001 ;
    static char  buf[BUFSIZE] ;
    static char  *psta=buf, *pend=buf ;
    if (psta >= pend){
        psta = buf;
        pend = buf + fread(buf,1,BUFSIZE,stdin);
        if (psta >= pend)
            return -1;
    }
    return *psta++;
}
inline int read(int &x) READ_INTEGER
inline int read(long long &x) READ_INTEGER
inline int read(double &x) READ_REAL
inline int read(float &x) READ_REAL
inline int read(char *x) READ_STRING
int dp[2100][2];
int a[maxn];
int n;
int dfs(int pos ,int p)
{
    if (dp[pos][p]!=-1)return dp[pos][p];
    int &ans=dp[pos][p];
    if (pos==n)return ans=abs(a[n-1]-a[n]);
    ans=abs(a[pos-1]-a[n]);
    for (int i=pos+1;i<=n;i++){
        if (!p) ans=max(ans,dfs(i,p^1));
        else ans=min(ans,dfs(i,p^1));
    }
    return ans;
}
int main()
{
    memset(dp,-1,sizeof(dp));
    int x,y;
    scanf("%d%d%d",&n,&x,&a[0]);
    for (int i=1;i<=n;i++)scanf("%d",&a[i]);
    printf("%d\n",dfs(1,0));
    return 0;
}


Measured memory_bytes: 384