N, Z, W  = list(map(int, input().split()))

a = [int(i) for i in input().split()]

if N==1:

  print((abs(a[0]-W)))

else:

  print((max(abs(a[-1]-W), abs(a[-1]-a[-2]))))
N, Z, W, *A = list(map(int, open(0).read().split()))

if N==1:

  print((abs(A[0]-W)))

else:

  print((max(abs(A[-1]-A[-2]),abs(A[-1]-W))))
N, Z, W = list(map(int, input().split()))
a = [int(i) for i in input().split()]
if N == 1:
    print((abs(a[0] - W)))
else:
    print((max(abs(a[-1] - W), abs(a[-1] - a[-2]))))

N, Z, W, *A = list(map(int, open(0).read().split()))
if N == 1:
    print((abs(A[0] - W)))
else:
    print((max(abs(A[-1] - A[-2]), abs(A[-1] - W))))

-N, Z, W = list(map(int, input().split())) -a = [int(i) for i in input().split()] +N, Z, W, *A = list(map(int, open(0).read().split())) -    print((abs(a[0] - W))) +    print((abs(A[0] - W))) -    print((max(abs(a[-1] - W), abs(a[-1] - a[-2])))) +    print((max(abs(A[-1] - A[-2]), abs(A[-1] - W))))