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