N = int(raw_input()) a = map(int, raw_input().split()) min = 200001 max = 0 for i in range(0, N): for j in range(i+1, N): d = abs(a[i]-a[j]) if d < min: min = d if max < d: max = d print min print max