R = [int(input()) for i in range(int(input()))]
maxp = R[1] - R[0]
minv = R[0]
for r in R[1:]:
    maxp = max(maxp, r-minv)
    minv = min(minv, r)
print(maxp) int(input()) for i in range(int(input())) for i in range(int(input())) i range(int(input())) range int(input()) int input() input for i in range(int(input())) int(input()) int input() input R = [int(input()) for i in range(int(input()))] R [int(input()) for i in range(int(input()))] maxp = R[1] - R[0] maxp R[1] - R[0] R[1] R 1 R[0] R 0 minv = R[0] minv R[0] R 0 for r in R[1:]:
    maxp = max(maxp, r-minv)
    minv = min(minv, r) r R[1:] R 1: 1 maxp = max(maxp, r-minv) maxp max(maxp, r-minv) max maxp r-minv r minv minv = min(minv, r) minv min(minv, r) min minv r print(maxp) print maxp minv = R[0] R[0] minv minv = min(minv, r) min(minv, r) minv R = [int(input()) for i in range(int(input()))] [int(input()) for i in range(int(input()))] R maxp = max(maxp, r-minv) max(maxp, r-minv) maxp maxp = R[1] - R[0] R[1] - R[0] maxp
R = [int(input()) for i in range(int(input()))]
maxp = R[1] - R[0]
minv = R[0]
for r in R[1:]:
    maxp = max(maxp, r-minv)
    minv = min(minv, r)
print(maxp)