#include <bits/stdc++.h>
using namespace std;
const int OpId = -1 * 500005;
long long n;
long long M[500005][21], a[500005], a1[500005], dp[500005], ar[500005];
vector<pair<long long, pair<long long, long long> > > querie;
map<long long, long long> mp;
vector<long long> vpos[500005];
long long ma(long long a, long long b) { return ((a - b > 0) ? a : b); }
long long mi(long long a, long long b) { return ((a - b > 0) ? b : a); }
long long va(long long a) { return (a > 0) ? a : -1 * a; }
vector<long long> v;
long long maxSum(vector<long long> v) {
  long long size = v.size();
  long long max_so_far = v[0];
  long long curr_max = v[0];
  for (int i = 1; i < size; i++) {
    curr_max = ma(v[i], curr_max + v[i]);
    max_so_far = ma(max_so_far, curr_max);
  }
  return max_so_far;
}
long long minSum(vector<long long> v) {
  long long size = v.size();
  long long min_so_far = v[0];
  long long curr_min = v[0];
  for (int i = 1; i < size; i++) {
    curr_min = mi(v[i], curr_min + v[i]);
    min_so_far = mi(min_so_far, curr_min);
  }
  return min_so_far;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  for (long long(i) = (0); (i) < (n); (i)++) cin >> ar[i];
  long long ct = 0, ct1 = 0;
  for (long long(i) = (0); (i) < (n - 1); (i)++) {
    if (i % 2 == 0) {
      a[ct] = va(ar[i + 1] - ar[i]);
      v.push_back(a[ct]);
      ct++;
    }
    if (i % 2 == 1) {
      a1[ct1] = va(ar[i + 1] - ar[i]);
      v.push_back(-1 * a1[ct1]);
      ct1++;
    }
  }
  long long mx = maxSum(v), mx1 = minSum(v);
  mx1 = va(mx1);
  cout << ma(mx1, mx) << endl;
  return 0;
}
