cnt = 0
for i in range(int(input())):
    c_num = int(input())
    if cnt == 0:
        r_min = c_num
    elif cnt == 1:
        p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
    else:
        if p_max < c_num - r_min:
            p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
    cnt += 1
print(p_max)
 cnt = 0 cnt 0 for i in range(int(input())):
    c_num = int(input())
    if cnt == 0:
        r_min = c_num
    elif cnt == 1:
        p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
    else:
        if p_max < c_num - r_min:
            p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
    cnt += 1 i range(int(input())) range int(input()) int input() input c_num = int(input()) c_num int(input()) int input() input if cnt == 0:
        r_min = c_num
    elif cnt == 1:
        p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
    else:
        if p_max < c_num - r_min:
            p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
     cnt == 0 cnt 0 r_min = c_num r_min c_num elif cnt == 1:
        p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
     cnt == 1 cnt 1 p_max = c_num - r_min p_max c_num - r_min c_num r_min if c_num < r_min:
            r_min = c_num
     c_num < r_min c_num r_min r_min = c_num r_min c_num if p_max < c_num - r_min:
            p_max = c_num - r_min
         p_max < c_num - r_min p_max c_num - r_min c_num r_min p_max = c_num - r_min p_max c_num - r_min c_num r_min if c_num < r_min:
            r_min = c_num
     c_num < r_min c_num r_min r_min = c_num r_min c_num cnt += 1 cnt 1 print(p_max) print p_max cnt = 0 0 cnt c_num = int(input()) int(input()) c_num p_max = c_num - r_min c_num - r_min p_max r_min = c_num c_num r_min cnt += 1 1 cnt p_max = c_num - r_min c_num - r_min p_max r_min = c_num c_num r_min r_min = c_num c_num r_min
cnt = 0
for i in range(int(input())):
    c_num = int(input())
    if cnt == 0:
        r_min = c_num
    elif cnt == 1:
        p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
    else:
        if p_max < c_num - r_min:
            p_max = c_num - r_min
        if c_num < r_min:
            r_min = c_num
    cnt += 1
print(p_max)

