#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long INF = 1e9;
const long long LINF = (long long)1e16 + 5;
int main() {
  int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int sub[n - 1];
  for (int i = 0; i < n - 1; i++) {
    if (i % 2 == 0)
      sub[i] = abs(a[i + 1] - a[i]);
    else
      sub[i] = -1 * abs(a[i] - a[i + 1]);
  }
  long long int sum[n - 1];
  memset(sum, 0, sizeof(sum));
  sum[0] = sub[0];
  for (int i = 1; i < n - 1; i++) {
    sum[i] = sum[i - 1] + sub[i];
  }
  long long int mx[n - 1], mn[n - 1];
  for (int i = 0; i < n - 1; i++) {
    mx[i] = -1000000000;
    mn[i] = 10000000000;
  }
  mx[n - 2] = sum[n - 2];
  mn[n - 2] = sum[n - 2];
  for (int i = n - 3; i >= 0; i--) {
    mx[i] = max(mx[i + 1], sum[i]);
    mn[i] = min(mn[i + 1], sum[i]);
  }
  long long int ans = -1000000000;
  for (int i = 0; i < n - 2; i++) {
    if (i % 2 == 0) {
      ans = max(ans, sub[i]);
      if (i == 0)
        ans = max(ans, mx[i + 1]);
      else
        ans = max(ans, mx[i + 1] - sum[i - 1]);
    } else {
      ans = max(ans, -1 * sub[i]);
      ans = max(ans, -1 * (mn[i + 1] - sum[i - 1]));
    }
  }
  if ((n - 2) % 2 == 0)
    ans = max(sub[n - 2], ans);
  else
    ans = max(-1 * sub[n - 2], ans);
  cout << ans << endl;
  return 0;
}
