#include <bits/stdc++.h>
using namespace std;
long long f(int *temp, int n) {
  long long ans = 0, cur = 0;
  for (int i = 0; i < n - 1; i++) {
    cur += temp[i];
    if (cur < 0) {
      cur = 0;
    }
    ans = max(ans, cur);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int temp[n], temp1[n], m = 1;
  for (int i = 0; i < n - 1; i++) {
    temp[i] = abs(arr[i] - arr[i + 1]) * m;
    temp1[i] = -1 * temp[i];
    m *= -1;
  }
  long long ans = f(temp, n);
  ans = max(ans, f(temp1, n));
  cout << ans << endl;
  return 0;
}
