num = int(input());
secda = input();
secd = secda.split(" ");

first = int(secd[0]);
enda = int(secd[num-1]);

maxin = enda - first;
minn = 0;
minh = int(secd[1]) - int(secd[0]);

for dat in range(1,num):
	minn = int(secd[dat]) - int(secd[dat-1]);
	if minh >= minn:
		minh = minn;

print(minh);
print(maxin);