gets p gets.split.map(&:to_i).uniq.each_cons(2).map{|x,y|y-x}.min||0