#include <bits/stdc++.h>
using namespace std;
long long a[200001];
long long b[200001];
int main() {
  int n, i, k, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n - 1; i++) {
    b[i] = abs(a[i + 1] - a[i]);
  }
  long long f = -1;
  long long ans1 = b[0], ans2 = b[1], ma1 = b[0], ma2 = b[1];
  for (i = 1; i < n - 1; i++) {
    ans1 = ans1 + f * b[i];
    f = f * (long long)(-1);
    if (ans1 > ma1) ma1 = ans1;
    if (ans1 < 0) ans1 = 0;
  }
  f = (long long)(-1);
  for (i = 2; i < n - 1; i++) {
    ans2 = ans2 + f * b[i];
    f = f * (long long)(-1);
    if (ans2 > ma2) ma2 = ans2;
    if (ans2 < 0) ans2 = 0;
  }
  cout << max(ma1, ma2);
}
