We have a deck consisting of N cards. Each card has an integer written on it. The integer on the i-th card from the top is a_i.

Two people X and Y will play a game using this deck. Initially, X has a card with Z written on it in his hand, and Y has a card with W written on it in his hand. Then, starting from X, they will alternately perform the following action:

* Draw some number of cards from the top of the deck. Then, discard the card in his hand and keep the last drawn card instead. Here, at least one card must be drawn.



The game ends when there is no more card in the deck. The score of the game is the absolute difference of the integers written on the cards in the two players' hand.

X will play the game so that the score will be maximized, and Y will play the game so that the score will be minimized. What will be the score of the game?

Constraints

* All input values are integers.
* 1 \leq N \leq 2000
* 1 \leq Z, W, a_i \leq 10^9

Input

Input is given from Standard Input in the following format:


N Z W
a_1 a_2 ... a_N


Output

Print the score.

Examples

Input

3 100 100
10 1000 100


Output

900


Input

3 100 1000
10 100 100


Output

900


Input

5 1 1
1 1 1 1 1


Output

0


Input

1 1 1
1000000000


Output

999999999
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

import javax.swing.text.Segment;

public class Main {
	
	public static long naive_dfs(int turn, long[] as, long Z, long W, int top){
		if(top >= as.length - 1){
			return Math.abs(Z - W);
		}
		
		if(turn == 0){
			long max = Long.MIN_VALUE;
			
			for(int next = top + 1; next < as.length; next++){
				max = Math.max(max, naive_dfs(1 - turn, as, as[next], W, next));
			}
			
			return max;
		}else{
			long min = Long.MAX_VALUE;
			
			for(int next = top + 1; next < as.length; next++){
				min = Math.min(min, naive_dfs(1 - turn, as, Z, as[next], next));
			}
			
			return min;
		}		
	}
	
	//public static long calls = 0;
	public static long memo_dfs(int turn, long[] as, long Z, long W, int top, int X_top, int Y_top, long[][] memo){
		final boolean can_use_memo = Math.min(X_top, Y_top) >= 0;
		
		//System.out.println(top + " " + Z + "[" + X_top + "]" +  " " + W + "[" + Y_top + "]");
		
		if(top >= as.length - 1){
			if(can_use_memo){
				return memo[top][turn] = Math.abs(Z - W);
			}else{
				return Math.abs(Z - W);
			}
		}else if(can_use_memo && memo[top][turn] >= 0){
			return memo[top][turn];
		}
		
		//calls++;
		
		if(turn == 0){
			long max = Long.MIN_VALUE;
			
			for(int next = top + 1; next < as.length; next++){
				max = Math.max(max, memo_dfs(1 - turn, as, as[next], W, next, next, Y_top, memo));
			}
			
			if(can_use_memo){
				return memo[top][turn] = max;
			}else{	
				return max;
			}
		}else{
			long min = Long.MAX_VALUE;
			
			for(int next = top + 1; next < as.length; next++){
				min = Math.min(min, memo_dfs(1 - turn, as, Z, as[next], next, X_top, next, memo));
			}
			
			if(can_use_memo){
				return memo[top][turn] = min;
			}else{
				return min;
			}
		}
		
	}
	
	public static void main(String[] args) throws IOException {
		try (Scanner sc = new Scanner(System.in)) {
			final int N = sc.nextInt();
			
			final long Z = sc.nextLong();
			final long W = sc.nextLong();
			long[] as = new long[N];
			for(int i = 0; i < N; i++){
				as[i] = sc.nextLong();
			}
			
			//System.out.println("start");
			//System.out.println(naive_dfs(0, as, Z, W, -1));
			long[][] memo = new long[N][2];
			for(int i = 0; i < N; i++){
				memo[i][0] = memo[i][1] = -1;
			}
			
			System.out.println(memo_dfs(0, as, Z, W, -1, -1, -1, memo));
			//System.out.println(calls);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}