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