#include <bits/stdc++.h>
using namespace std;
long long a[100004];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long count = 0, m = abs(a[1] - a[2]);
  int s = 1;
  for (int i = 1; i <= n - 1; i++) {
    count += abs(a[i] - a[i + 1]) * s;
    s *= -1;
    m = max(m, count);
    if (count < 0) {
      count = 0;
      s = 1;
      continue;
    }
  }
  count = 0;
  s = 1;
  for (int i = 2; i <= n - 1; i++) {
    count += abs(a[i] - a[i + 1]) * s;
    s *= -1;
    m = max(m, count);
    if (count < 0) {
      count = 0;
      s = 1;
      continue;
    }
  }
  cout << m << endl;
  return 0;
}
