#include <bits/stdc++.h>
using namespace std;
long long b[100000], m = 0;
int n;
void dp() {
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += b[i];
    if (sum < 0) sum = 0;
    m = max(m, sum);
  }
}
int main() {
  cin >> n;
  long long num, last;
  cin >> last;
  n--;
  for (int i = 0; i < n; i++) {
    cin >> num;
    b[i] = (i & 1 ? -1 : 1) * llabs(num - last);
    last = num;
  }
  dp();
  for (int i = 0; i < n; i++) b[i] = -b[i];
  dp();
  cout << m;
  return 0;
}
