f,p,m;main(t){for(;~scanf("%d",&t);)!m?m=-1e9:f?m=fmax(m,p+~t):(f=t),p=t;printf("%d\n%d",~m,t-f);}