#include <bits/stdc++.h>
using namespace std;
struct DP_NODE {
  long long int maxval, minval;
};
DP_NODE dp[200005];
long long int a[200005];
int n;
int main(int argc, char* argv[]) {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%I64d", &a[i]);
  dp[n - 2].maxval = abs(a[n - 2] - a[n - 1]);
  dp[n - 2].minval = 0;
  long long int ans = dp[n - 2].maxval;
  for (int i = n - 3; i >= 0; --i) {
    long long int tmp = abs(a[i] - a[i + 1]);
    dp[i].maxval = max(tmp, -dp[i + 1].minval + tmp);
    dp[i].minval = min(tmp, -dp[i + 1].maxval + tmp);
    ans = max(ans, dp[i].maxval);
  }
  printf("%I64d\n", ans);
  return 0;
}
