while True:
try:
n=int(input())
l=list(map(int,input().split()))
a=[]
for i in range(0,n-2):
a.append(l[i+2]-l[i])
j=a.index(min(a))
del l[j+1]
b=[]
for i in range(len(l)):
b.append(l[i]-l[i-1])
print(max(b))
except:
break