#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n], b[n - 1], max1 = 0, max2 = 0, maximum = 0, j, sumev = 0,
                                sumod = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) b[i] = abs(a[i + 1] - a[i]);
  for (int i = 0; i < n - 1; i++) {
    if (i % 2 == 0) {
      sumev += b[i];
      sumod -= b[i];
    } else {
      sumev -= b[i];
      sumod += b[i];
    }
    sumev = max(sumev, (long long int)0);
    sumod = max(sumod, (long long int)0);
    maximum = max(maximum, max(sumev, sumod));
  }
  cout << maximum;
}
