import sys,math

n=0
max_v=-math.pow(10,10)
s=math.pow(10,10)
for line in sys.stdin:
    l=int(line)
    if n == 0:
        n=l
        continue
    diff=l-s
    if diff>max_v:
        max_v=diff
    if diff<0:
        s=l
        

print max_v import sys,math sys math n=0 n 0 max_v=-math.pow(10,10) max_v -math.pow(10,10) math.pow(10,10) math.pow math pow 10 10 s=math.pow(10,10) s math.pow(10,10) math.pow math pow 10 10 for line in sys.stdin:
    l=int(line)
    if n == 0:
        n=l
        continue
    diff=l-s
    if diff>max_v:
        max_v=diff
    if diff<0:
        s=l
         line sys.stdin sys stdin l=int(line) l int(line) int line if n == 0:
        n=l
        continue
     n == 0 n 0 n=l n l continue diff=l-s diff l-s l s if diff>max_v:
        max_v=diff
     diff>max_v diff max_v max_v=diff max_v diff if diff<0:
        s=l
         diff<0 diff 0 s=l s l print max_v=-math.pow(10,10) -math.pow(10,10) max_v n=0 0 n l=int(line) int(line) l max_v=diff diff max_v n=l l n s=math.pow(10,10) math.pow(10,10) s diff=l-s l-s diff s=l l s
import sys,math

n=0
max_v=-math.pow(10,10)
s=math.pow(10,10)
for line in sys.stdin:
    l=int(line)
    if n == 0:
        n=l
        continue
    diff=l-s
    if diff>max_v:
        max_v=diff
    if diff<0:
        s=l
        

print max_v