#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const long long int INF = 1e15 + 10;
long long int n;
long long int v[N];
vector<long long int> a, b;
long long int solve(const vector<long long int> &vet) {
  long long int ans = vet[0], current = vet[0];
  for (int i = 1; i < vet.size(); i++) {
    current = max(vet[i], current + vet[i]);
    ans = max(ans, current);
  }
  return ans;
}
int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &v[i]);
  }
  for (int i = 1; i < n; ++i) {
    a.push_back(abs(v[i] - v[i - 1]) * ((i & 1) ? 1 : -1));
    b.push_back(abs(v[i] - v[i - 1]) * ((i & 1) ? -1 : 1));
  }
  printf("%lld\n", max(solve(a), solve(b)));
  return 0;
}
