#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n - 1], x, y, dp[n - 1], dpm[n - 1];
  cin >> x;
  for (int i = 0; i < n - 1; ++i) {
    cin >> y;
    a[i] = abs(x - y);
    x = y;
  }
  dp[n - 2] = a[n - 2];
  dpm[n - 2] = a[n - 2];
  int i = n - 2;
  while (i--) {
    dp[i] = max(a[i], a[i] - dpm[i + 1]);
    dpm[i] = min(a[i], a[i] - dp[i + 1]);
  }
  long long mx = -1e9;
  for (int j = 0; j < n - 1; ++j) {
    mx = max(dp[j], mx);
  }
  cout << mx << endl;
  return 0;
}
