#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  long long sum = 0, z = 0, s = 0, m = 0, mm = 0;
  cin >> n;
  vector<long long> a(n);
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < (n - 1); i++) {
    if (i % 2 == 0)
      sum = sum + abs(a[i + 1] - a[i]);
    else
      sum = max(z, sum - abs(a[i + 1] - a[i]));
    m = max(m, sum);
  }
  for (i = 1; i < (n - 1); i++) {
    if (i % 2 == 1)
      s = s + abs(a[i + 1] - a[i]);
    else
      s = max(z, s - abs(a[i + 1] - a[i]));
    m = max(s, m);
  }
  cout << m;
}
