#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f3f3f3f3f;
const int maxn = 100000 + 190;
long long a[maxn];
long long b[maxn];
long long presum[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  presum[0] = 0;
  long long ans = INT64_MIN;
  long long oddm = -inf, evenm = 0;
  for (int i = 1; i < n; i++) {
    b[i] = abs(a[i] - a[i - 1]);
    if (i & 1)
      presum[i] = presum[i - 1] + b[i];
    else
      presum[i] = presum[i - 1] - b[i];
    ans = max({ans, presum[i] - evenm, oddm - presum[i]});
    if (i & 1)
      oddm = max(oddm, presum[i]);
    else
      evenm = min(evenm, presum[i]);
  }
  cout << ans << endl;
}
