#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
int main() {
  int n, i;
  cin >> n;
  for (i = 0; i < n; i++) scanf("%d", a + i);
  for (i = 0; i < n - 1; i++) b[i] = abs(a[i] - a[i + 1]);
  for (i = 1; i < n - 1; i += 2) b[i] = -b[i];
  n--;
  long long cur = 0, ans = 0;
  for (i = 0; i < n; i++) {
    cur = max(0ll, cur + b[i]);
    ans = max(ans, cur);
  }
  for (i = 0; i < n; i++) b[i] = -b[i];
  cur = 0;
  for (i = 0; i < n; i++) {
    cur = max(0ll, cur + b[i]);
    ans = max(ans, cur);
  }
  cout << ans;
}
