#include <bits/stdc++.h>
using namespace std;
int n;
long long a[100002], f[100002], g[100002], p[100002], q[100002];
int main() {
  long long h, fm = 0, gm = 0, pm = 0, qm = 0;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int(i) = (0); (i) < (n); i++) {
    cin >> a[i];
    if (i % 2 == 1 and i > 0) {
      f[i - 1] = abs(a[i - 1] - a[i]) * (1);
    } else if (i % 2 == 0 and i > 0) {
      f[i - 1] = abs(a[i - 1] - a[i]) * (-1);
    }
    if (i % 2 == 1 and i > 0) {
      g[i - 1] = abs(a[i - 1] - a[i]) * (-1);
    } else if (i % 2 == 0 and i > 0) {
      g[i - 1] = abs(a[i - 1] - a[i]) * (1);
    }
  }
  h = 0;
  for (int(i) = (0); (i) < (n - 1); i++) {
    if (i % 2 == 0) {
      if (h < 0) h = 0;
    }
    h += f[i];
    if (h > fm) fm = h;
  }
  h = 0;
  for (int(i) = (1); (i) < (n - 1); i++) {
    if (i % 2 == 1) {
      if (h < 0) h = 0;
    }
    h += g[i];
    if (h > gm) gm = h;
  }
  cout << max(fm, gm);
  cout << endl;
  return 0;
}
