N = int(input())
A  = [int(input()) for i in range(N)]

dp = [-(10**10)]*N
dp[0] = A[1]-A[0]
for i in range(1,N-1):
    dp[i] = max(A[i+1]-A[i]+dp[i-1], A[i+1]-A[i])

print(max(dp))
 N = int(input()) N int(input()) int input() input int(input()) for i in range(N) for i in range(N) i range(N) range N for i in range(N) int(input()) int input() input A  = [int(input()) for i in range(N)] A [int(input()) for i in range(N)] dp = [-(10**10)]*N dp [-(10**10)]*N [-(10**10)] -(10**10) 10**10 10 10 N dp[0] = A[1]-A[0] dp[0] dp 0 A[1]-A[0] A[1] A 1 A[0] A 0 for i in range(1,N-1):
    dp[i] = max(A[i+1]-A[i]+dp[i-1], A[i+1]-A[i]) i range(1,N-1) range 1 N-1 N 1 dp[i] = max(A[i+1]-A[i]+dp[i-1], A[i+1]-A[i]) dp[i] dp i max(A[i+1]-A[i]+dp[i-1], A[i+1]-A[i]) max A[i+1]-A[i]+dp[i-1] A[i+1]-A[i] A[i+1] A i+1 i 1 A[i] A i dp[i-1] dp i-1 i 1 A[i+1]-A[i] A[i+1] A i+1 i 1 A[i] A i print(max(dp)) print max(dp) max dp A  = [int(input()) for i in range(N)] [int(input()) for i in range(N)] A N = int(input()) int(input()) N dp = [-(10**10)]*N [-(10**10)]*N dp
N = int(input())
A  = [int(input()) for i in range(N)]

dp = [-(10**10)]*N
dp[0] = A[1]-A[0]
for i in range(1,N-1):
    dp[i] = max(A[i+1]-A[i]+dp[i-1], A[i+1]-A[i])

print(max(dp))

