#include <bits/stdc++.h>
using namespace std;
long long int maxSubArraySum(long long int a[], long long int b[],
                             long long int size) {
  long long int max_so_far = 0, max_ending_here = 0;
  for (long long int i = 0; i < size; i++) {
    if (i % 2)
      max_ending_here = max_ending_here + b[i];
    else
      max_ending_here = max_ending_here + a[i];
    if (max_ending_here < 0)
      max_ending_here = 0;
    else if (max_so_far < max_ending_here)
      max_so_far = max_ending_here;
  }
  max_ending_here = 0;
  long long int mx2 = 0;
  for (long long int i = 0; i < size; i++) {
    if (i % 2)
      max_ending_here = max_ending_here + a[i];
    else
      max_ending_here = max_ending_here + b[i];
    if (max_ending_here < 0)
      max_ending_here = 0;
    else if (mx2 < max_ending_here)
      mx2 = max_ending_here;
  }
  return max(mx2, max_so_far);
}
int main() {
  long long int n;
  cin >> n;
  long long int a[n], x[n - 1], y[n - 1];
  for (long long int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (long long int i = 0; i < n - 1; ++i) {
    x[i] = abs(a[i] - a[i + 1]);
    y[i] = -x[i];
  }
  cout << maxSubArraySum(x, y, n - 1) << endl;
  return 0;
}
