#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long b[100005];
long long d[100005];
long long maxim = 0, n, ceva;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    d[i] = abs(a[i] - a[i + 1]);
  }
  maxim = 0;
  for (int i = 0; i < 2; i++) {
    ceva = 1;
    long long sum = 0;
    for (int j = i; j < n - 1; j++) {
      sum += d[j] * ceva;
      ceva *= -1;
      if (sum < 0) {
        sum = 0;
        ceva = 1;
      }
      if (sum > maxim) {
        maxim = sum;
      }
    }
  }
  cout << maxim;
  return 0;
}
