#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
using pii = pair<long long, long long>;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<long long> b(n);
  for (long long i = 1; i < n; i++) {
    b[i] = b[i - 1];
    long long cur = abs(a[i - 1] - a[i]);
    if (i % 2)
      b[i] += cur;
    else
      b[i] -= cur;
  }
  long long ev = 0, odd = 1;
  long long ans = 0;
  for (long long i = 1; i < n; i++) {
    ans = max(ans, max(b[i] - b[ev], -b[i] + b[odd]));
    if (i % 2 == 0 && b[i] - b[ev] <= 0)
      ev = i;
    else if (i % 2 == 1 && b[odd] - b[i] <= 0)
      odd = i;
  }
  cout << ans << "\n";
  return 0;
}
