#! ruby # yukicoder My Practice # author: Leonardone @ NEETSDKASU N = gets.to_i X = gets.chomp.split.map(&:to_i) x = X.sort.uniq if x.size > 1 puts x.zip(x.rotate(1)).map{|x,y| (x - y).abs}[0...-1].min else puts 0 end