#include <bits/stdc++.h>
using namespace std;
long long tabela[(int)1e5 + 100];
long long dp(vector<long long> &second, long long idx, long long L) {
  if (tabela[idx] != -1) return tabela[idx];
  if (idx <= L) return tabela[idx] = second[L];
  return tabela[idx] = max(second[idx], second[idx] + dp(second, idx - 1, L));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> v[i];
  }
  vector<long long> s1(n - 1);
  for (long long i = 0; i < n - 1; i++) {
    s1[i] = (long long)abs(v[i] - v[i + 1]);
    if (i % 2) {
      s1[i] *= -1;
    }
  }
  long long maior = (long long)-1e10;
  memset(tabela, -1, sizeof(tabela));
  for (long long i = 0; i < (long long)s1.size(); i++) {
    maior = max(maior, dp(s1, i, 0));
  }
  for (int i = 0; i < (int)(s1.size()); i++) s1[i] *= -1;
  memset(tabela, -1, sizeof(tabela));
  for (long long i = 1; i < (long long)s1.size(); i++) {
    maior = max(maior, dp(s1, i, 1));
  }
  cout << maior << "\n";
  ;
  return 0;
}
