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