#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int inf = (int)1e9 + 10;
const int mod = (int)1e9 + 7;
const double eps = 1e-7;
const double pi = 3.14159265359;
const int maxLen = (int)1e5 + 2;
int A[maxLen];
long long D[maxLen];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  D[1] = abs(A[1] - A[2]);
  for (int i = 2; i < n; i++) {
    D[i] = D[i - 1];
    if (i % 2)
      D[i] += abs(A[i] - A[i + 1]);
    else
      D[i] -= abs(A[i] - A[i + 1]);
  }
  long long ans = D[1];
  long long minSum = 0;
  long long maxSum = 0;
  for (int i = 1; i < n; i++) {
    if (i % 2)
      ans = max({ans, D[i] - minSum, D[i] - maxSum});
    else
      ans = max({ans, maxSum - D[i], minSum - D[i]});
    minSum = min(D[i], minSum);
    maxSum = max(D[i], maxSum);
  }
  printf("%lld", ans);
  return 0;
}
