#include <bits/stdc++.h>
using namespace std;
long long kadane(vector<long long> &v) {
  long long sum = v[0];
  long long maxSum = v[0];
  for (long long i = 1; i < v.size(); i++) {
    sum = max(sum + v[i], v[i]);
    maxSum = max(maxSum, sum);
  }
  return maxSum;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  vector<long long> diff(n - 1);
  for (long long i = 0; i < n - 1; i++) diff[i] = abs(v[i] - v[i + 1]);
  vector<long long> diff1(n - 1);
  vector<long long> diff2(n - 1);
  for (long long i = 0; i < n - 1; i++) {
    if (i % 2 != 0) {
      diff1[i] = -diff[i];
      diff2[i] = diff[i];
    } else {
      diff1[i] = diff[i];
      diff2[i] = -diff[i];
    }
  }
  long long ans1 = kadane(diff1);
  long long ans2 = kadane(diff2);
  long long finalAns = max(ans1, ans2);
  cout << finalAns << "\n";
}
