#include <bits/stdc++.h>
using namespace std;
long long int maxSubArraySum(long long int a[], int size) {
  long long int max_so_far = LONG_MIN, max_ending_here = 0, start = 0, end = 0,
                s = 0;
  for (int i = 0; i < size; i++) {
    max_ending_here += a[i];
    if (max_so_far < max_ending_here) {
      max_so_far = max_ending_here;
      start = s;
      end = i;
    }
    if (max_ending_here < 0) {
      max_ending_here = 0;
      s = i + 1;
    }
  }
  return max_so_far;
}
int main() {
  int n;
  long long int a[100000], val[100000], val2[100000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0)
      continue;
    else {
      if (i % 2 == 0) {
        val[i - 1] = abs(a[i] - a[i - 1]);
        val2[i - 1] = -1 * abs(a[i] - a[i - 1]);
      } else {
        val2[i - 1] = abs(a[i] - a[i - 1]);
        val[i - 1] = -1 * abs(a[i] - a[i - 1]);
      }
    }
  }
  long long int ans = maxSubArraySum(val, n - 1);
  long long int temp = maxSubArraySum(val2, n - 1);
  ans = ans > temp ? ans : temp;
  cout << ans << endl;
  return 0;
}
