n = gets.split(" ").map(&:to_i)

a = []
an = []
a = gets.split(" ").map(&:to_i)
a = a.sort
if  a.size == 2

  print a.max

elsif a.size == 3

  an << a[1] - a[0]
  an << a[2] - a[0]

  ans = an.max
  ans = a[0] if ans == 0
  print ans
  
elsif a.size <= 4

  an << a[1] - a[0]
  an << a[2] - a[0]
  an << a[3] - a[0]

  an << a[2] - a[1]
  an << a[3] - a[1]

  an << a[3] - a[2]

  ans = an.select{ |e| an.count(e) > 1 }.uniq
  answer = ans.max
  answer = a[0] if answer == 0
  print answer
  
end






