#include <bits/stdc++.h>
using namespace std;
int n;
int a[110000];
long long b[110000];
long long c[110000];
long long d[110000];
int getZ(int x) {
  if (x % 2 == 0)
    return 1;
  else
    return -1;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) b[i] = abs(a[i] - a[i + 1]);
  long long ans = -(long long)1e15;
  long long sum = 0;
  long long min_sum = 0;
  for (int i = 0; i < n - 1; ++i) {
    sum += b[i] * (i % 2 == 0 ? 1 : -1);
    ans = max(ans, sum - min_sum);
    if (i % 2 == 1) min_sum = min(min_sum, sum);
  }
  sum = 0;
  min_sum = (long long)1e15;
  for (int i = 0; i < n - 1; ++i) {
    sum += b[i] * (i % 2 == 1 ? 1 : -1);
    ans = max(ans, sum - min_sum);
    if (i % 2 == 0) min_sum = min(min_sum, sum);
  }
  cout << ans << "\n";
}
