#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 0x7FFFFFFFFFFFFFFF / 2;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long arr[n];
  vector<long long> pos, neg;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long sig = 1;
  for (int i = 0; i < n - 1; i++) {
    pos.push_back(sig * abs(arr[i + 1] - arr[i]));
    sig *= -1;
  }
  sig = 1;
  for (int i = 1; i < n - 1; i++) {
    neg.push_back(sig * abs(arr[i + 1] - arr[i]));
    sig *= -1;
  }
  long long ans_maximus = -INT_MAX;
  long long max_so_far = -INT_MAX, max_ending_here = 0;
  for (int i = 0; i < pos.size(); i++) {
    max_ending_here = max_ending_here + pos[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  ans_maximus = max(ans_maximus, max_so_far);
  max_so_far = -INT_MAX, max_ending_here = 0;
  for (int i = 0; i < neg.size(); i++) {
    max_ending_here = max_ending_here + neg[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  ans_maximus = max(ans_maximus, max_so_far);
  cout << ans_maximus;
  return 0;
}
