#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long N;
  cin >> N;
  long long v[N];
  for (long long i = 0; i < N; i++) cin >> v[i];
  long long arr1[N - 1], arr2[N - 1];
  for (long long i = 0; i < N - 1; i++) {
    arr1[i] = -1 * abs(v[i + 1] - v[i]);
    arr2[i] = abs(v[i + 1] - v[i]);
    if (i & 1) swap(arr1[i], arr2[i]);
  }
  long long max1[N - 1], max2[N - 1];
  max1[0] = arr1[0];
  max2[0] = arr2[0];
  for (long long i = 1; i < N - 1; i++)
    max1[i] = max(max1[i - 1] + arr1[i], arr1[i]);
  for (long long i = 1; i < N - 1; i++)
    max2[i] = max(max2[i - 1] + arr2[i], arr2[i]);
  long long ans = 0;
  for (long long i = 0; i < N - 1; i++) ans = max(ans, max(max1[i], max2[i]));
  cout << ans;
  return 0;
}
