#include <bits/stdc++.h>
using namespace std;
long long Get(const vector<long long> &ps, const int &l, const int &r) {
  if (l & 1) {
    return (ps[l - 1] - ps[r]);
  } else {
    return (l == 0 ? ps[r] : ps[r] - ps[l - 1]);
  }
}
void Solve() {
  int n;
  cin >> n;
  vector<long long> tmp(n);
  for (int(i) = (0); (i) < (n); ++(i)) cin >> tmp[i];
  vector<long long> a;
  for (int(i) = (0); (i) < (n - 1); ++(i))
    a.push_back(abs(tmp[i] - tmp[i + 1]));
  n = (int)(a).size();
  vector<long long> ps(n, a[0]);
  for (int(i) = (1); (i) < (n); ++(i))
    ps[i] = ps[i - 1] + (i & 1 ? -1 : 1) * a[i];
  long long ans = max(*max_element((ps).begin(), (ps).end()),
                      *max_element((a).begin(), (a).end()));
  long long mn = (1LL << 30LL), mx = -(1LL << 60LL);
  for (int(i) = (0); (i) < (n); ++(i)) {
    long long val = max(ps[i] - mn, mx - ps[i]);
    ans = max(ans, val);
    mx = max(mx, ps[i]);
    mn = min(mn, ps[i]);
  }
  cout << ans;
}
int main() {
  Solve();
  return 0;
}
