#include <bits/stdc++.h>
using namespace std;
long long arr[200005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> temp;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    if (i) {
      temp.push_back(abs(arr[i] - arr[i - 1]));
    }
  }
  for (long long i = 1; i < n - 1; i += 2) {
    temp[i] = -temp[i];
  }
  long long overallMax = temp[0], mx = INT_MIN;
  long long curr = temp[0];
  for (long long i = 1; i < n - 1; i++) {
    curr = max(temp[i], curr + temp[i]);
    overallMax = max(overallMax, curr);
  }
  mx = max(mx, overallMax);
  for (long long i = 1; i < n - 1; i += 2) {
    temp[i] = -temp[i];
  }
  for (long long i = 0; i < n - 1; i += 2) {
    temp[i] = -temp[i];
  }
  overallMax = temp[1], curr = temp[1];
  for (long long i = 2; i < n - 1; i++) {
    curr = max(temp[i], curr + temp[i]);
    overallMax = max(overallMax, curr);
  }
  mx = max(mx, overallMax);
  cout << mx << endl;
  return 0;
}
