#include <bits/stdc++.h>
using namespace std;
int prime(long long n) {
  if (n < 2) return 0;
  for (long long i = 2; i * i <= n; ++i)
    if (n % i == 0) return 0;
  return 1;
}
long long ss(vector<long long> a) {
  int n = a.size();
  long long ans = a[0];
  long long sum = 0;
  long long min_sum = 0;
  for (int r = 0; r < n; ++r) {
    sum += a[r];
    ans = max(ans, sum - min_sum);
    min_sum = min(min_sum, sum);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> b(n - 1);
  vector<long long> c(n - 1);
  long long q = 1;
  cin >> a[0];
  for (int i = 1; i < n; ++i) {
    cin >> a[i];
    b[i - 1] = abs(a[i] - a[i - 1]);
    if (i % 2 == 0) b[i - 1] = -b[i - 1];
    c[i - 1] = -b[i - 1];
  }
  cout << max(ss(c), ss(b)) << endl;
}
