#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};
const int MXN = 1e5 + 134;
long long int calc(vector<long long int>& a) {
  long long int temp = 0, ans = -1e18;
  long long int n = (long long int)a.size();
  for (long long int i = 0; i < n; i++) {
    temp += a[i];
    ckmax(ans, temp);
    ckmax(temp, 0LL);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (auto& x : v) cin >> x;
  vector<long long int> a(n - 1), b(n - 1);
  int sign = 1;
  for (long long int i = 0; i < n - 1; i++) {
    a[i] = sign * abs(v[i + 1] - v[i]);
    sign *= -1;
    b[i] = -a[i];
  }
  cout << max(calc(a), calc(b));
  return 0;
}
