#include <bits/stdc++.h>
using namespace std;
int i;
long long a[100005];
long long b[100005];
int main() {
  int n;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (i = 1; i < n; i++) {
    b[i] = llabs(a[i] - a[i + 1]);
  }
  long long bestSum = -200000000000000000LL, sum = 0, sum2 = 0,
            maxim = -200000000000000000LL, idx = 1;
  long long minim = 0, minales;
  for (i = 1; i < n; i++) {
    if ((i - idx) % 2 == 1) {
      sum = sum - b[i];
    } else
      sum = sum + b[i];
    if (sum > maxim) {
      maxim = sum;
      minales = minim;
    }
    if (sum < minim) {
      minim = sum;
    }
  }
  idx = 1, sum = 0;
  bestSum = maxim - minales;
  maxim = -200000000000000000LL;
  minim = minales = 0;
  for (i = 2; i < n; i++) {
    if ((i - idx) % 2 == 0) {
      sum = sum - b[i];
    } else
      sum = sum + b[i];
    if (sum > maxim) {
      maxim = sum;
      minales = minim;
    }
    if (sum < minim) {
      minim = sum;
    }
  }
  if (bestSum < maxim - minales) {
    bestSum = maxim - minales;
  }
  cout << bestSum;
}
