#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, i;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  long long b[n - 1], c[n - 1];
  for (i = 0; i < n - 1; i++) {
    if (i % 2 == 0) {
      b[i] = abs(a[i] - a[i + 1]);
      c[i] = -1 * abs(a[i + 1] - a[i]);
    } else {
      c[i] = abs(a[i] - a[i + 1]);
      b[i] = -1 * abs(a[i + 1] - a[i]);
    }
  }
  for (i = 1; i < n - 1; i++) {
    b[i] += b[i - 1];
    c[i] += c[i - 1];
  }
  long long bm[n - 1], cm[n - 1];
  bm[n - 2] = b[n - 2];
  cm[n - 2] = c[n - 2];
  for (i = n - 3; i >= 0; i--) {
    bm[i] = max(b[i], bm[i + 1]);
    cm[i] = max(c[i], cm[i + 1]);
  }
  long long ans = bm[0];
  for (i = 0; i < n - 1; i++) {
    if (b[i] == bm[i])
      ans = max(ans, bm[i]);
    else
      ans = max(ans, abs(bm[i] - b[i]));
    if (c[i] == cm[i])
      ans = max(ans, cm[i]);
    else
      ans = max(abs(cm[i] - c[i]), ans);
  }
  cout << ans;
  return 0;
}
