#include <bits/stdc++.h>
using namespace std;
long long a[555555], n;
long long b[555555];
long long Abs(long long x) {
  if (x < 0) x = -x;
  return x;
}
long long f(long long y[], int n) {
  long long sum = 0;
  long long tmp = 0;
  for (int i = 0; i < n; ++i) {
    if (tmp >= 0) {
      tmp += y[i];
    } else if (tmp < 0)
      tmp = y[i];
    if (tmp > sum) sum = tmp;
  }
  return sum;
}
int main() {
  while (cin >> n) {
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n - 1; ++i) {
      b[i] = Abs(a[i] - a[i + 1]);
      if (i % 2 == 1) b[i] = -b[i];
    }
    long long ans1 = f(b, n - 1);
    for (int i = 0; i < n - 1; ++i) {
      if (i % 2 == 0)
        b[i] = -Abs(b[i]);
      else
        b[i] = Abs(b[i]);
    }
    long long ans2 = f(b, n - 1);
    cout << (ans1 > ans2 ? ans1 : ans2) << endl;
  }
  return 0;
}
