#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
using ll = long long;
ll a[maxn];
ll b[maxn];
ll c[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i < n; ++i) {
    a[i] = abs(a[i] - a[i + 1]);
  }
  int flag = 1;
  for (int i = 1; i < n; ++i) {
    b[i] = a[i] * flag;
    flag *= -1;
  }
  flag = -1;
  for (int i = 1; i < n; ++i) {
    c[i] = a[i] * flag;
    flag *= -1;
  }
  ll mmax = 0x3fffffff * -1;
  ll tmpb = 0;
  ll tmpc = 0;
  for (int i = 1; i < n; ++i) {
    tmpb += b[i];
    tmpc += c[i];
    if (tmpb < 0) tmpb = 0;
    if (tmpc < 0) tmpc = 0;
    mmax = max(mmax, tmpb);
    mmax = max(mmax, tmpc);
  }
  cout << mmax << endl;
  return 0;
}
