n = int(input()) numList = list(map(int, input().split())) numList = sorted(numList) min for i in range(n): if (i == n - 1): break val = abs(numList[i] - numList[i + 1]) if i == 0: # 初回の場合 無条件で最小値を代入 min = val continue; elif min > abs(val): min = val print(min)