io.write((function (f) local n,l,r = f(),f(),f() local d=r-l for _=3,n do local t=f() d,r=d>t-r and t-r or d,t end return d, "\n", r-l, "\n" end)((function (M) M.cdef 'int scanf(const char *, ...);' local C,c = M.C,M.new("int[1]") return function () C.scanf("%d",c) return c[0] end end)(require'ffi')))