n = io.read("*n") prev, f = nil, 0 min = 0 for i = 1, n do a = io.read("*n") if(prev == nil) then prev, f = a, a else if(min == 0) then min = a - prev else min = math.min(min, a - prev) end prev = a end end io.write(string.format("%d\n%d\n", min, prev - f))