#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int maxn = 100100;
int n;
int a[maxn + 5], b[maxn + 5];
long long sum[maxn + 5];
int main() {
  scanf("%d", &n);
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) scanf("%d", a + i);
  for (int i = (0), i_end_ = (n - 1); i < i_end_; ++i)
    b[i] = abs(a[i] - a[i + 1]);
  long long Max0 = 0, Max1 = 0;
  sum[n - 1] = 0;
  long long ans = 0;
  for (int i = n - 2; i >= 0; --i) {
    sum[i] = sum[i + 1] + ((i & 1) ? -b[i] : b[i]);
    chkmax(Max0, -sum[i]);
    chkmax(Max1, sum[i]);
    if (i & 1)
      chkmax(ans, -sum[i] + Max1);
    else
      chkmax(ans, sum[i] + Max0);
  }
  cout << ans << endl;
  return 0;
}
