#include <bits/stdc++.h>
using namespace std;
const int maxn = 110000;
int n;
long long arr[maxn];
long long pre1[maxn], pre2[maxn];
long long dp1[maxn], dp2[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &arr[i]);
  for (int i = 1; i < n; i++) {
    pre1[i] = abs(arr[i] - arr[i + 1]) * ((i & 1) ? 1 : -1);
    pre2[i] = -pre1[i];
  }
  pre2[1] = 0;
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    if (i & 1)
      dp1[i] = max(dp1[i - 1] + pre1[i], pre1[i]);
    else
      dp1[i] = max(0LL, dp1[i - 1] + pre1[i]);
    ans = max(ans, dp1[i]);
  }
  for (int i = 2; i < n; i++) {
    if (!(i & 1))
      dp2[i] = max(dp2[i - 1] + pre2[i], pre2[i]);
    else
      dp2[i] = max(0LL, dp2[i - 1] + pre2[i]);
    ans = max(ans, dp2[i]);
  }
  cout << ans << endl;
  return 0;
}
