#!/bin/python import sys n = int(raw_input().strip()) a = map(int, raw_input().strip().split(' ')) # your code goes here #smallest_abs = 1e11 #for i in range(n-1): # for j in range(i+1, n): # current_abs = abs(a[i]-a[j]) # if current_abs < smallest_abs: # smallest_abs = current_abs #print smallest_abs sorted_a = sorted(a) smallest_abs = 1e20 for i in range(n-1): current_abs = abs(sorted_a[i] - sorted_a[i+1]) if current_abs < smallest_abs: smallest_abs = current_abs print smallest_abs