#include <bits/stdc++.h>
using namespace std;
long long dp[100005], a[100005];
int main() {
  ios::sync_with_stdio(false);
  int n;
  long long ans1 = 0, ans2 = 0, ans = 0, pre, now;
  cin >> n;
  cin >> pre;
  for (int i = 1; i < n; i++) {
    cin >> now;
    a[i] = abs(now - pre);
    pre = now;
  }
  for (int i = 1; i < n; i++) {
    if (i & 1) {
      ans1 = max(ans1, ans1 + a[i]);
      ans2 = max(0ll, ans2 - a[i]);
    } else {
      ans2 = max(ans2, ans2 + a[i]);
      ans1 = max(0ll, ans1 - a[i]);
    }
    ans = max(ans, max(ans1, ans2));
  }
  cout << ans << endl;
}
