#include <bits/stdc++.h>
using namespace std;
int a[100 * 1000];
int b[100 * 1000];
int main() {
  ios::sync_with_stdio(false);
  int n;
  long long max = (-1) * 1e15, maxn, maxp;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  maxn = maxp = abs(a[n - 2] - a[n - 1]);
  for (int i = n - 2; i >= 0; i--) {
    long long t = maxn;
    maxn = abs(a[i] - a[i + 1]) - maxp;
    maxp = abs(a[i] - a[i + 1]) - t;
    if (maxp < abs(a[i] - a[i + 1])) maxp = abs(a[i] - a[i + 1]);
    if (maxp > max) max = maxp;
  }
  cout << max << endl;
  return 0;
}
