#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int a[N];
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    a[i] = abs(a[i] - a[i + 1]);
  }
  n--;
  long long mx = INT_MIN;
  long long sm = 0;
  for (int i = 0; i < n; i++) {
    int x = ((i % 2 == 0) ? a[i] : -a[i]);
    sm = max(1LL * x, sm + x);
    mx = max(mx, sm);
  }
  sm = 0;
  for (int i = 0; i < n; i++) {
    int x = ((i % 2 == 1) ? a[i] : -a[i]);
    sm = max(1LL * x, sm + x);
    mx = max(mx, sm);
  }
  cout << mx;
}
int main() {
  solve();
  getchar();
  getchar();
}
