#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long l, long long md) {
  a %= md;
  long long res = 1;
  while (l) {
    if (l & 1) res = res * a % md;
    l /= 2;
    a = a * a % md;
  }
  return res;
}
long long binpow(long long a, long long l) {
  long long res = 1;
  while (l) {
    if (l & 1) res = res * a;
    l /= 2;
    a = a * a;
  }
  return res;
}
long long invmod(long long a, long long md) { return powmod(a, md - 2, md); }
long long __set(long long b, long long i) { return b | (1LL << i); }
long long __unset(long long b, long long i) { return b & (~(1UL << i)); }
long long __check(long long b, long long i) { return b & (1LL << i); }
long long mulmod(long long a, long long b, long long md) {
  return (((a % md) * (b % md)) % md + md) % md;
}
long long addmod(long long a, long long b, long long md) {
  return ((a % md + b % md) % md + md) % md;
}
long long submod(long long a, long long b, long long md) {
  return (((a % md - b % md) % md) + md) % md;
}
long long divmod(long long a, long long b, long long md) {
  return mulmod(a, powmod(b, md - 2, md), md);
}
const long long inf = 0xFFFFFFFFFFFFFFFL;
priority_queue<long long, vector<long long>, greater<long long> > pq;
long long __ceil(long long n, long long d) {
  long long ans = n / d;
  if (n % d != 0) ans++;
  return ans;
}
signed main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long dpmn[n], dpmx[n];
  dpmn[n - 2] = abs(a[n - 2] - a[n - 1]),
           dpmx[n - 2] = abs(a[n - 2] - a[n - 1]);
  for (long long i = n - 3; i >= 0; i--) {
    dpmn[i] = min(abs(a[i] - a[i + 1]), abs(a[i] - a[i + 1]) - dpmx[i + 1]);
    dpmx[i] = max(abs(a[i] - a[i + 1]), abs(a[i] - a[i + 1]) - dpmn[i + 1]);
  }
  cout << *max_element(dpmx, dpmx + n - 1) << "\n";
  return 0;
}
