#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int main() {
  int n;
  long long a[maxn];
  long long dp[maxn], cp[maxn];
  while (cin >> n) {
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) a[i] = abs(a[i + 1] - a[i]);
    long long ans = 0;
    for (int i = n - 2; i >= 0; i--) {
      dp[i] = max(a[i], a[i] - cp[i + 1]);
      cp[i] = min(a[i], a[i] - dp[i + 1]);
      ans = max(ans, dp[i]);
    }
    cout << ans << endl;
  }
}
