#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> data(n + 1);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &data[i]);
  }
  vector<long long> b(n + 1);
  vector<long long> c(n + 1);
  vector<long long> pref1(n + 1);
  vector<long long> pref2(n + 1);
  for (int i = 1; i < n; i++) {
    b[i] = abs(data[i + 1] - data[i]) * (pow(-1, i));
    c[i] = abs(data[i + 1] - data[i]) * (pow(-1, i + 1));
  }
  pref1[1] = b[1];
  pref2[1] = c[1];
  for (int i = 2; i <= n; i++) {
    pref1[i] = pref1[i - 1] + b[i];
    pref2[i] = pref2[i - 1] + c[i];
  }
  long long bMax = *max_element(pref1.begin(), pref1.end());
  long long cMax = *max_element(pref2.begin(), pref2.end());
  printf("%lld", cMax + bMax);
  return 0;
}
