#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> v(n), b(n - 1), c(n - 2);
  for (int i = 0; i < n; i++) cin >> v[i];
  b[0] = abs(v[1] - v[0]);
  if (n == 2) {
    cout << b[0];
    return 0;
  }
  for (int i = 2; i < n; i++) {
    if (i % 2)
      b[i - 1] = abs(v[i] - v[i - 1]);
    else
      b[i - 1] = -abs(v[i] - v[i - 1]);
  }
  c[0] = abs(v[2] - v[1]);
  for (int i = 3; i < n; i++) {
    if (i % 2 == 0)
      c[i - 2] = abs(v[i] - v[i - 1]);
    else
      c[i - 2] = -abs(v[i] - v[i - 1]);
  }
  long long tmp = 0, hi = 0;
  for (int i = 0; i < n - 1; i++) {
    tmp += b[i];
    hi = max(hi, tmp);
    if (tmp < 0) tmp = 0;
  }
  hi = max(hi, tmp);
  tmp = 0;
  for (int i = 0; i < n - 2; i++) {
    tmp += c[i];
    hi = max(hi, tmp);
    if (tmp < 0) tmp = 0;
  }
  hi = max(hi, tmp);
  cout << hi;
}
