#include <bits/stdc++.h>
using namespace std;
int N, A[100500];
long long B[100500];
long long tbs[100500], tbb[100500];
long long ans = (long long)-1e18;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i]);
  }
  for (int i = 1; i < N; i++) {
    B[i] = A[i] - A[i + 1];
    if (B[i] < 0) B[i] = -B[i];
    if (i % 2 == 0) B[i] = -B[i];
  }
  for (int i = N - 1; i >= 1; i--) {
    tbs[i] = min(B[i], tbs[i + 1] + B[i]);
    tbb[i] = max(B[i], tbb[i + 1] + B[i]);
    if (i % 2 == 0) ans = max(ans, -tbs[i]);
    if (i % 2 == 1) ans = max(ans, tbb[i]);
  }
  printf("%lld\n", ans);
  return 0;
}
