#include <bits/stdc++.h>
using namespace std;
long long p[100010];
long long Abs(long long n) {
  if (n < 0) return -n;
  return n;
}
int main() {
  int n, fu = 1;
  long long now = 0, Max = 0, ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &p[i]);
  for (int i = 1; i < n; i++) {
    if (now + Abs(p[i] - p[i + 1]) * fu < 0)
      now = 0;
    else {
      now += Abs(p[i] - p[i + 1]) * fu;
      ans = max(ans, now);
    }
    if (fu == 1)
      fu = -1;
    else
      fu = 1;
  }
  now = 0, fu = 1;
  for (int i = 2; i < n; i++) {
    if (now + Abs(p[i] - p[i + 1]) * fu < 0)
      now = 0;
    else {
      now += Abs(p[i] - p[i + 1]) * fu;
      ans = max(ans, now);
    }
    if (fu == 1)
      fu = -1;
    else
      fu = 1;
  }
  printf("%I64d\n", ans);
  return 0;
}
