#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N];
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long sum = 0;
  long long maxSum = -1e14;
  for (int i = 0; i + 1 < n; i++) {
    if (i % 2 == 0) {
      sum += abs(a[i] - a[i + 1]);
      maxSum = max(maxSum, sum);
    } else {
      sum += -abs(a[i] - a[i + 1]);
      sum = max(sum, 0ll);
    }
  }
  sum = 0;
  for (int i = 1; i + 1 < n; i++) {
    if (i & 1) {
      sum += abs(a[i] - a[i + 1]);
      maxSum = max(maxSum, sum);
    } else {
      sum += -abs(a[i] - a[i + 1]);
      sum = max(sum, 0ll);
    }
  }
  cout << maxSum;
}
