n = input()
Max = -4300000000
Min = input()
for i in range(n - 1):
    IN_NOW = input()

    Max = max(Max, (IN_NOW - Min))    
    Min = min(Min, IN_NOW)
    
print Max n = input() n input() input Max = -4300000000 Max -4300000000 Min = input() Min input() input for i in range(n - 1):
    IN_NOW = input()

    Max = max(Max, (IN_NOW - Min))    
    Min = min(Min, IN_NOW)
     i range(n - 1) range n - 1 n 1 IN_NOW = input() IN_NOW input() input Max = max(Max, (IN_NOW - Min)) Max max(Max, (IN_NOW - Min)) max Max IN_NOW - Min IN_NOW Min Min = min(Min, IN_NOW) Min min(Min, IN_NOW) min Min IN_NOW print n = input() input() n Max = -4300000000 -4300000000 Max IN_NOW = input() input() IN_NOW Min = input() input() Min Max = max(Max, (IN_NOW - Min)) max(Max, (IN_NOW - Min)) Max Min = min(Min, IN_NOW) min(Min, IN_NOW) Min
n = input()
Max = -4300000000
Min = input()
for i in range(n - 1):
    IN_NOW = input()

    Max = max(Max, (IN_NOW - Min))    
    Min = min(Min, IN_NOW)
    
print Max