#!/bin/python3 import sys n = int(input().strip()) a = list(map(int, input().strip().split(' '))) # your code goes here a.sort() difference = abs(a[1] - a[0]) for i in range(0,len(a)): if i + 1 < len(a): if abs(a[i+1] - a[i]) < difference: difference = abs(a[i+1] - a[i]) print(difference)