#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 0, j = 0, cs = 0, in;
  int n;
  cin >> n;
  vector<int> v, a, b;
  for (i = 0; i < n; i++) {
    cin >> in;
    v.push_back(in);
  };
  for (i = 0; i < n - 1; i++) {
    int x = abs(v[i + 1] - v[i]);
    if (i & 1)
      a.push_back(-1 * x), b.push_back(x);
    else
      a.push_back(x), b.push_back(-1 * x);
  }
  long long ma = 0, mb = 0;
  long long cnt = 0;
  for (i = 0; i < a.size(); i++) {
    cnt += a[i];
    if (cnt < 0) cnt = 0;
    ma = max(ma, cnt);
  }
  cnt = 0;
  for (i = 0; i < b.size(); i++) {
    cnt += b[i];
    if (cnt < 0) cnt = 0;
    mb = max(mb, cnt);
  }
  cout << max(ma, mb) << "\n";
  return 0;
}
