#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MOD = 1000000000 + 7;
long long arr[MAXN];
long long a[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, t;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &arr[i]);
  }
  long long m = 1;
  for (int i = 1; i < n; i++) {
    a[i] = m * abs(arr[i] - arr[i + 1]);
    m = -m;
  }
  long long ans = 0, sum = 0;
  for (int i = 1; i < n; i++) {
    sum += a[i];
    if (sum < 0) sum = 0;
    ans = max(ans, sum);
  }
  sum = 0;
  for (int i = 1; i < n; i++) {
    a[i] = -a[i];
    sum += a[i];
    if (sum < 0) sum = 0;
    ans = max(ans, sum);
  }
  cout << ans;
  return 0;
}
