#include <bits/stdc++.h>
using namespace std;
long long int cal(vector<int> f) {
  long long int sum = 0;
  long long int cur = 0;
  for (int i = 0; i < f.size(); ++i) {
    cur += f[i];
    if (cur < 0) {
      cur = 0;
    }
    if (cur > sum) {
      sum = cur;
    }
  }
  return sum;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n), f(n - 1);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i < n; ++i) {
    f[i - 1] = pow(-1, i - 1) * abs(a[i - 1] - a[i]);
  }
  long long int sum = cal(f);
  for (int i = 1; i < n; ++i) {
    f[i - 1] = pow(-1, i) * abs(a[i - 1] - a[i]);
  }
  long long int sum2 = cal(f);
  cout << max(sum, sum2) << endl;
  return 0;
}
