#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long int> arr, arr2, x, y;
  int n;
  long long int temp;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &temp);
    arr.push_back(temp);
  }
  for (int i = 0; i < n - 1; i++) {
    arr2.push_back(abs(arr[i] - arr[i + 1]));
  }
  for (int i = 0; i < n - 1; i++) {
    if (i & 1) {
      x.push_back(arr2[i]);
      y.push_back(-arr2[i]);
    } else {
      x.push_back(-arr2[i]);
      y.push_back(arr2[i]);
    }
  }
  long long int p = 0, s = 0;
  for (int k = 0; k < n - 1; k++) {
    s = max(x[k], s + x[k]);
    p = max(p, s);
  }
  long long int p2 = 0, s2 = 0;
  for (int k = 0; k < n - 1; k++) {
    s2 = max(y[k], s2 + y[k]);
    p2 = max(p2, s2);
  }
  cout << max(p2, p) << "\n";
  return 0;
}
