#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long d[100005];
long long Min[100005];
long long Max[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    d[i] = abs(a[i + 1] - a[i]);
  }
  Min[n - 1] = Max[n - 1] = 0;
  long long ans = -1000000000;
  for (int i = n - 2; i >= 0; i--) {
    Min[i] = min(0LL, d[i] - Max[i + 1]);
    Max[i] = max(0LL, d[i] - Min[i + 1]);
    ans = max(ans, Max[i]);
  }
  cout << ans << endl;
  return 0;
}
