#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:500000000")
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-9;
const long long INF = static_cast<long long>(1e18);
int a[(int)1e5 + 9];
int f[(int)1e5 + 9];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n - 1; ++i) {
    f[i] = abs(a[i] - a[i + 1]);
  }
  --n;
  long long res = -INF;
  long long curSum = 0;
  long long minSum = 0;
  for (int i = n - 1; i >= 0; i -= 2) {
    if (i + 1 < n) {
      curSum -= f[i + 1];
    }
    minSum = min(minSum, curSum);
    curSum += f[i];
    res = max(res, curSum - minSum);
    minSum = min(minSum, curSum);
  }
  curSum = 0;
  minSum = 0;
  for (int i = n - 2; i >= 0; i -= 2) {
    if (i + 1 < n) {
      curSum -= f[i + 1];
    }
    minSum = min(minSum, curSum);
    curSum += f[i];
    res = max(res, curSum - minSum);
    minSum = min(minSum, curSum);
  }
  printf("%lld\n", res);
  return 0;
}
