#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int k = n - 1;
  int dif[n - 1];
  for (int i = 0; i < k; i++) {
    dif[i] = pow(-1, i) * abs(arr[i] - arr[i + 1]);
  }
  long long int max1 = -1e18, min1 = 1e18, end1 = 0, end2 = 0;
  for (int i = 0; i < k; i++) {
    end1 += dif[i];
    end2 += dif[i];
    if (end1 > max1) max1 = end1;
    if (end1 < 0) end1 = 0;
    if (end2 > 0) end2 = 0;
    if (end2 < min1) min1 = end2;
  }
  cout << max(max1, -1 * min1);
  return 0;
}
