#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5, INF = 0x7F;
long long n, a[maxn], f[maxn], sum[maxn], Max = -INF, Min = INF;
int main() {
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  Max = max(Max, 0ll);
  Min = min(Min, 0ll);
  for (int i = 1; i < n; i++) {
    f[i] = abs(a[i] - a[i + 1]);
    sum[i] = sum[i - 1] + (i & 1 ? f[i] : -f[i]);
    Max = max(sum[i], Max);
    Min = min(sum[i], Min);
  }
  printf("%lld\n", Max - Min);
  return 0;
}
