#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
const double pi = 3.1415926535897932384626433832795;
using namespace std;
long long ans = -MAXINT, n;
long long x1[300000];
long long x2[300000];
void check(long long xx) {
  long long sum = 0, i;
  for (long long i = xx; i < n; i++) {
    sum += x2[i];
    ans = max(sum, ans);
    if (sum < 0) sum = 0;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  long long i, j;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> x1[i];
  for (i = 1; i < n; i++) {
    x2[i] = abs(x1[i] - x1[i + 1]);
    if (!(i & 1)) x2[i] *= -1;
  }
  check(1);
  for (i = 2; i < n; i++) {
    x2[i] = abs(x1[i] - x1[i + 1]);
    if (i & 1) x2[i] *= -1;
  }
  check(2);
  cout << ans << endl;
  return 0;
}
