#include <bits/stdc++.h>
using namespace std;
long long n;
long long mxm(vector<long long> arr) {
  long long max_so_far = arr[1], cur_max = arr[1];
  for (long long i = (2); i < (n); ++i) {
    cur_max = max(arr[i], cur_max + arr[i]);
    max_so_far = max(max_so_far, cur_max);
  }
  return max_so_far;
}
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  vector<long long> a(n + 1);
  for (long long i = (1); i < (n + 1); ++i) cin >> a[i];
  vector<long long> dp1(n), dp2(n);
  for (long long i = (1); i < (n); ++i) {
    dp1[i] = abs(a[i] - a[i + 1]) * pow(-1, i % 2);
    dp2[i] = abs(a[i] - a[i + 1]) * pow(-1, (i % 2) + 1);
  }
  long long mx = mxm(dp1);
  mx = max(mx, mxm(dp2));
  cout << mx;
}
