#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long ans1 = LLONG_MIN, ans2 = LLONG_MIN, mx1 = 0, mx2 = 0;
  vector<long long> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  for (int i = 1; i < n; ++i) {
    if (i % 2 == 0) {
      mx1 = max(mx1 - abs(v[i] - v[i - 1]), 0LL);
      ans1 = max(ans1, mx1);
      mx2 = max(mx2 + abs(v[i] - v[i - 1]), 0LL);
      ans2 = max(ans2, mx2);
    } else {
      mx1 = max(mx1 + abs(v[i] - v[i - 1]), 0LL);
      ans1 = max(ans1, mx1);
      mx2 = max(mx2 - abs(v[i] - v[i - 1]), 0LL);
      ans2 = max(ans2, mx2);
    }
  }
  cout << max(ans1, ans2) << '\n';
}
