#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int m) {
  if (y == 0) return 1;
  long long int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long int nCr(long long int n, long long int r, long long int m) {
  if (r > n) return 0;
  long long int a = 1, b = 1, i;
  for (i = 0; i < r; i++) {
    a = (a * n) % m;
    --n;
  }
  while (r) {
    b = (b * r) % m;
    --r;
  }
  return (a * power(b, m - 2, m)) % m;
}
void solve() {
  int n;
  cin >> n;
  vector<long long int> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  vector<long long int> ans1, ans2;
  for (int i = 0; i < n - 1; ++i) {
    if (i % 2 == 0)
      ans1.push_back(abs(v[i] - v[i + 1]));
    else
      ans1.push_back(-1 * (abs(v[i] - v[i + 1])));
    if (i > 0) {
      if (i % 2)
        ans2.push_back(abs(v[i] - v[i + 1]));
      else
        ans2.push_back(-1 * (abs(v[i] - v[i + 1])));
    }
  }
  long long int ans = 0, temp = 0;
  for (int i = 0; i < (int)ans1.size(); ++i) {
    temp += ans1[i];
    if (temp < 0) temp = 0;
    ans = max(temp, ans);
  }
  temp = 0;
  for (int i = 0; i < (int)ans2.size(); ++i) {
    temp += ans2[i];
    if (temp < 0) temp = 0;
    ans = max(temp, ans);
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
