#include <bits/stdc++.h>
using namespace std;
long long maxsubsum(vector<int> &vec) {
  long long maxsum = 0;
  long long cursum = 0;
  for (int i = 0; i < vec.size(); i++) {
    cursum += vec[i];
    if (cursum < 0) cursum = 0;
    maxsum = max(maxsum, cursum);
  }
  return maxsum;
}
int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  vector<int> dif(n - 1);
  for (int i = 0; i < n; i++) cin >> vec[i];
  for (int i = 0; i < n - 1; i++) dif[i] = abs(vec[i] - vec[i + 1]);
  vector<int> dif2 = dif, dif1 = dif;
  for (int i = 0; i < n - 1; i += 2) dif1[i] = -dif1[i];
  for (int i = 1; i < n - 1; i += 2) dif2[i] = -dif2[i];
  cout << max(maxsubsum(dif1), maxsubsum(dif2));
}
