#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i, s = 0, m = 0, x = 0, y = 0, l = 0;
  cin >> n;
  vector<long long> a(n);
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n - 1; i++) a[i] = abs(a[i] - a[i + 1]);
  for (i = 0; i < n - 1; i++) {
    if (i % 2 == 0)
      x += a[i];
    else
      x -= a[i];
    if (a[i] > x && i % 2 == 0) x = a[i];
    if (i % 2)
      y += a[i];
    else if (i % 2 == 0 && i > 0)
      y -= a[i];
    if (i % 2 && a[i] > y) y = a[i];
    if (x > s) s = x;
    if (y > s) s = y;
  }
  cout << s << endl;
}
