f,p,i,m;main(t){for(;~scanf("%d",&t);)i++?f?m=m&&m>p+~t?m:p+~t:(f=t),p=t:0;printf("%d\n%d",~m,t-f);}