#include <bits/stdc++.h>
using namespace std;
long long fastPow(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    b >>= 1;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, e, o, ce, co, ret = INT_MIN, c;
  cin >> n;
  vector<long long> nums(n + 1);
  for (int i = int(1); i < int(n + 1); i++) cin >> nums[i];
  e = 0, o = 0, ce = 0, co = 0, c = 0;
  for (int l = int(1); l < int(n); l++) {
    if (!(l % 2)) {
      e = abs(nums[l] - nums[l + 1]);
      ce = max(ce + e, c);
      o = e * -1;
      co = max(co + o, c);
    } else {
      e = abs(nums[l] - nums[l + 1]) * -1;
      ce = max(ce + e, c);
      o = e * -1;
      co = max(co + o, c);
    }
    ret = max(ret, max(ce, co));
  }
  cout << ret << endl;
  return 0;
}
