#!/bin/python import sys n = int(raw_input().strip()) a = map(int, raw_input().strip().split(' ')) # your code goes here a.sort() minnum = float('inf') for idx in range(len(a) - 1): if abs(a[idx] - a[idx + 1]) < minnum: minnum = abs(a[idx] - a[idx + 1]) print minnum