test_case = gets.chomp.to_i list = gets.chomp.split.map(&:to_i).uniq.sort! distance = 1000000 for i in 0...list.length - 1 do distance = (list[i + 1] - list[i]).abs if distance > (list[i + 1] - list[i]).abs end puts distance