#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int MAXN = 100001;
long long int num[MAXN];
long long int Kadane(const vector<long long int>& A) {
  if (!A.size()) return 0;
  long long int maxi = A[0];
  long long int sum = 0;
  int j = 0;
  for (int i = 0; i < A.size(); i++) {
    sum += A[i];
    while (sum < 0 && j <= i) sum -= A[j++];
    maxi = max(maxi, sum);
  }
  return maxi;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> num[i];
  vector<long long int> A;
  int f = 1;
  for (int i = 0; i < n - 1; i++) {
    A.push_back(abs(num[i] - num[i + 1]) * f);
    f *= -1;
  }
  long long int ans = Kadane(A);
  vector<long long int> B;
  f = 1;
  for (int i = 0; i < n - 1; i++) {
    if (!i) continue;
    B.push_back(abs(num[i] - num[i + 1]) * f);
    f *= -1;
  }
  cout << max(ans, Kadane(B)) << '\n';
  return 0;
}
