#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 * 2 + 10;
long long dp[N][2], n, a[N], s[N], ans = 0;
int32_t main() {
  cin >> n;
  for (long long i = (1); i <= (n); ++i) cin >> a[i];
  for (long long i = (1); i <= (n - 1); ++i) s[i] = abs(a[i] - a[i + 1]);
  for (long long i = (1); i <= (n - 1); ++i) {
    dp[i][0] = max(dp[i - 1][1] + s[i], s[i]);
    dp[i][1] = dp[i - 1][0] - s[i];
    ans = max({ans, dp[i][0], dp[i][1]});
  }
  cout << ans;
  return 0;
}
