#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<long long> ans1(n - 1);
  long long res = -1;
  for (long long i = 0; i < n - 1; i++) {
    if (i % 2) {
      ans1[i] = -abs(a[i + 1] - a[i]);
    } else
      ans1[i] = abs(a[i + 1] - a[i]);
  }
  for (long long i = 1; i < n - 1; i++) {
    ans1[i] = max(ans1[i], ans1[i - 1] + ans1[i]);
    res = max(res, ans1[i]);
  }
  res = max(res, ans1[0]);
  for (long long i = 0; i < n - 1; i++) {
    if (i % 2) {
      ans1[i] = abs(a[i + 1] - a[i]);
    } else
      ans1[i] = -abs(a[i + 1] - a[i]);
  }
  for (long long i = 1; i < n - 1; i++) {
    ans1[i] = max(ans1[i], ans1[i - 1] + ans1[i]);
    res = max(res, ans1[i]);
  }
  res = max(res, ans1[0]);
  cout << res;
}
