#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (auto &it : a) cin >> it;
  ;
  long long ans = -1e18, sum = 0;
  for (int i = 0; i < n - 1; i++) {
    if (i % 2 == 0) {
      sum += abs(a[i] - a[i + 1]);
    } else {
      sum -= abs(a[i] - a[i + 1]);
    }
    if (sum <= 0) {
      sum = 0;
    }
    ans = max(ans, sum);
  }
  sum = 0;
  for (int i = 1; i < n - 1; i++) {
    if (i % 2 == 1) {
      sum += abs(a[i] - a[i + 1]);
    } else {
      sum -= abs(a[i] - a[i + 1]);
    }
    if (sum <= 0) {
      sum = 0;
    }
    ans = max(ans, sum);
  }
  cout << ans << '\n';
}
int main() { solve(); }
