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