#include <bits/stdc++.h>
using namespace std;
long long v[200050], sp1[200050], sp2[200050];
int main() {
  int n, i, k, first, iteratii = 0;
  long long minsp1 = 0, minsp2 = 0, ans = -0x3f3f3f3fLL;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> v[i];
  for (i = 1; i < n; ++i) {
    sp1[i] = sp1[i - 1] + abs(v[i] - v[i + 1]) * ((i % 2 == 0) ? -1 : 1);
    sp2[i] = sp2[i - 1] + abs(v[i] - v[i + 1]) * ((i % 2 == 0) ? 1 : -1);
    ans = max(ans, sp1[i] - minsp1);
    ans = max(ans, sp2[i] - minsp2);
    minsp1 = min(minsp1, sp1[i]);
    minsp2 = min(minsp2, sp2[i]);
  }
  cout << ans;
  return 0;
}
