#include <bits/stdc++.h>
using namespace std;
long long const N = 1e6 + 5;
long long dp[N][2], a[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  n--;
  for (int i = 0; i < n; i++) a[i] = abs(a[i] - a[i + 1]);
  long long mx = a[n - 1];
  dp[n - 1][0] = a[n - 1], dp[n - 1][1] = -1 * a[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    dp[i][0] = max(a[i], a[i] + dp[i + 1][1]);
    dp[i][1] = max(-1 * a[i], dp[i + 1][0] - a[i]);
    mx = max(mx, dp[i][0]);
  }
  cout << mx << endl;
}
