#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005], n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i < n; i++) b[i] = abs(a[i] - a[i + 1]);
  long long s = b[1], s1 = b[1];
  int l = 1;
  for (int i = 2; i < n; i++) {
    while (s <= 0 && i - l > 1) s -= b[l] - b[l + 1], l += 2;
    s += b[i] * (i % 2 ? 1 : -1);
    s1 = max(s1, s);
  }
  while (l < n - 1) s -= b[l] - b[l + 1], l += 2, s1 = max(s1, s);
  s1 = max(s = b[2], s1);
  l = 2;
  for (int i = 3; i < n; i++) {
    while (s <= 0 && i - l > 1) s -= b[l] - b[l + 1], l += 2;
    s += b[i] * (i % 2 ? -1 : 1);
    s1 = max(s1, s);
  }
  while (l < n - 1) s -= b[l] - b[l + 1], l += 2, s1 = max(s1, s);
  cout << s1;
  return 0;
}
