#include <bits/stdc++.h>
using namespace std;
const long long int N = 200010;
const long long mod = 1000000007;
const long long inf = 1000000000000000000;
const long double pi = 3.14159265358979323846264338;
long long int kadane_algo(vector<long long int> a) {
  long long int ans = a[0], curr = a[0];
  for (long long int i = 1; i < a.size(); i++) {
    curr = max(a[i], curr + a[i]);
    ans = max(ans, curr);
  }
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long int> v;
  for (long long int i = 0; i < n - 1; i++) {
    v.push_back(abs(a[i] - a[i + 1]));
  }
  vector<long long int> v1, v2;
  for (long long int i = 0; i < v.size(); i++) {
    if (i % 2)
      v1.push_back(v[i]);
    else
      v1.push_back(-v[i]);
  }
  for (long long int i = 0; i < v.size(); i++) {
    if (i % 2)
      v2.push_back(-v[i]);
    else
      v2.push_back(v[i]);
  }
  cout << max(kadane_algo(v1), kadane_algo(v2));
  return 0;
}
