#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5) + 5;
int n;
int a[N];
long long dp[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i <= n; cin >> a[i++])
    ;
  for (int i = 1; i <= n - 1; i++) a[i] = abs(a[i] - a[i + 1]);
  dp[1] = (long long)a[1];
  for (int i = 2; i <= n - 1; i++) {
    if (i % 2 == 0)
      dp[i] = dp[i - 1] - (long long)a[i];
    else
      dp[i] = dp[i - 1] + (long long)a[i];
  }
  sort(dp, dp + n);
  cout << dp[n - 1] - dp[0] << '\n';
  return 0;
}
