#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  for (long long i = 0; i < n - 1; i++)
    v[i] = (i & 1) ? -(llabs(v[i] - v[i + 1])) : llabs(v[i] - v[i + 1]);
  long long mx = v[0], tm = 0;
  for (long long i = 0; i < n - 1; i++) {
    tm += v[i];
    mx = max(mx, tm);
    if (tm < 0) tm = 0;
  }
  tm = 0;
  for (long long i = 1; i < n - 1; i++) {
    tm += (-v[i]);
    mx = max(mx, tm);
    if (tm < 0) tm = 0;
  }
  cout << mx;
}
