num = raw_input()
num_list = []
for i in range(int(num)):
        a = raw_input()
        num_list.append(int(a))

maxv = -10000000000000
minv = num_list[0]

for i in range(1, len(num_list)):
        maxv = max(maxv, num_list[i] - minv)
        minv = min(minv, num_list[i])

print maxv num = raw_input() num raw_input() raw_input num_list = [] num_list [] for i in range(int(num)):
        a = raw_input()
        num_list.append(int(a)) i range(int(num)) range int(num) int num a = raw_input() a raw_input() raw_input num_list.append(int(a)) num_list.append num_list append int(a) int a maxv = -10000000000000 maxv -10000000000000 minv = num_list[0] minv num_list[0] num_list 0 for i in range(1, len(num_list)):
        maxv = max(maxv, num_list[i] - minv)
        minv = min(minv, num_list[i]) i range(1, len(num_list)) range 1 len(num_list) len num_list maxv = max(maxv, num_list[i] - minv) maxv max(maxv, num_list[i] - minv) max maxv num_list[i] - minv num_list[i] num_list i minv minv = min(minv, num_list[i]) minv min(minv, num_list[i]) min minv num_list[i] num_list i print maxv = max(maxv, num_list[i] - minv) max(maxv, num_list[i] - minv) maxv num_list = [] [] num_list num = raw_input() raw_input() num maxv = -10000000000000 -10000000000000 maxv minv = num_list[0] num_list[0] minv a = raw_input() raw_input() a minv = min(minv, num_list[i]) min(minv, num_list[i]) minv
num = raw_input()
num_list = []
for i in range(int(num)):
        a = raw_input()
        num_list.append(int(a))

maxv = -10000000000000
minv = num_list[0]

for i in range(1, len(num_list)):
        maxv = max(maxv, num_list[i] - minv)
        minv = min(minv, num_list[i])

print maxv