#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  long long int dp[n - 1];
  for (long long int i = 0; i < n - 1; i++) dp[i] = abs(v[i] - v[i + 1]);
  long long int curMax = 0;
  long long int ans = 0;
  long long int f = 1;
  for (long long int i = 0; i < n - 1; i++) {
    curMax += dp[i] * f;
    if (curMax < 0) {
      curMax = 0;
    }
    f = f * (-1);
    ans = max(ans, curMax);
  }
  f = -1;
  curMax = 0;
  for (long long int i = 0; i < n - 1; i++) {
    curMax += dp[i] * f;
    if (curMax < 0) {
      curMax = 0;
    }
    f = f * (-1);
    ans = max(ans, curMax);
  }
  std::cout << ans << std::endl;
  return 0;
}
