#include <bits/stdc++.h>
using namespace std;
long long a[1000001];
int main() {
  long long n, k;
  cin >> n >> k;
  long long count = 0;
  for (long long i = 0; i < n - 1; i++) {
    long long x;
    cin >> x;
    count += (pow(-1, i) * (abs(k - x)));
    a[i] = count;
    k = x;
  }
  sort(a, a + n - 1);
  if (a[0] >= 0)
    cout << a[n - 2];
  else
    cout << a[n - 2] - a[0];
  return 0;
}
