#include <bits/stdc++.h>
using namespace std;
long long a[105000];
long long b[105000];
long long n;
long long gao() {
  long long x = 0, ret = 0;
  for (long long i = 1; i < n; i++) {
    x += b[i];
    ret = max(ret, x);
    if (x < 0) x = 0;
  }
  return ret;
}
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i < n; i++) {
    b[i] = a[i] - a[i + 1];
    if (b[i] < 0) b[i] *= -1;
    if (i % 2 == 0) b[i] *= -1;
  }
  long long r = gao();
  for (long long i = 1; i < n; i++) b[i] *= -1;
  r = max(r, gao());
  cout << r << endl;
  return 0;
}
