#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL);
  int n;
  while (cin >> n) {
    long long a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    if (n == 2) {
      cout << abs(a[0] - a[1]) << endl;
      continue;
    }
    long long ar1[n - 1], ar2[n - 2];
    for (int i = 0; i < n - 1; i++)
      ar1[i] = abs(a[i] - a[i + 1]) * (i & 1 ? -1 : 1);
    for (int i = 1; i < n - 1; i++)
      ar2[i - 1] = abs(a[i] - a[i + 1]) * (i & 1 ? 1 : -1);
    long long maxi1 = ar1[0], c1 = maxi1, maxi2 = ar2[0], c2 = maxi2;
    for (int i = 1; i < n - 1; i++) {
      c1 = max(c1 + ar1[i], ar1[i]);
      maxi1 = max(maxi1, c1);
    }
    for (int i = 1; i < n - 2; i++) {
      c2 = max(c2 + ar2[i], ar2[i]);
      maxi2 = max(maxi2, c2);
    }
    cout << max(maxi1, maxi2) << endl;
  }
  return 0;
}
