#include <bits/stdc++.h>
using namespace std;
long long int maxs(vector<long long int> a) {
  long long int size = a.size();
  long long int max_so_far = 0, max_ending_here = 0;
  for (long long int i = 0; i < size; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_ending_here < 0)
      max_ending_here = 0;
    else if (max_so_far < max_ending_here)
      max_so_far = max_ending_here;
  }
  return max_so_far;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  long long int temp[n - 1];
  for (long long int i = 0; i < n - 1; i++) temp[i] = abs(arr[i] - arr[i + 1]);
  vector<long long int> first, second;
  for (long long int i = 0; i < n - 1; i++) {
    if (i % 2)
      first.push_back(-temp[i]);
    else
      first.push_back(temp[i]);
  }
  for (long long int i = 1; i < n - 1; i++) {
    if (i % 2)
      second.push_back(temp[i]);
    else
      second.push_back(-temp[i]);
  }
  long long int ans = max(maxs(first), maxs(second));
  cout << ans << "\n";
  return 0;
}
