#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
long long a[N], b[N], c[N], d[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
  }
  for (int i = 1; i < n; i++) {
    d[i] = abs(a[i + 1] - a[i]);
    b[i] = c[i] = d[i];
  }
  for (int i = 1; i < n; i += 2) b[i] *= -1;
  for (int i = 2; i < n; i += 2) c[i] *= -1;
  long long mn = 0, now = 0;
  long long res1 = 0, res2 = 0;
  for (int i = 1; i < n; i++) {
    now += b[i];
    mn = min(mn, now);
    res1 = max(res1, now - mn);
  }
  now = mn = 0;
  for (int i = 1; i < n; i++) {
    now += c[i];
    mn = min(mn, now);
    res2 = max(res2, now - mn);
  }
  printf("%lld\n", max(res1, res2));
  return 0;
}
