#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long dp[100005][2];
int main() {
  int n;
  while (cin >> n) {
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= n; i++) cin >> a[i];
    int x = 1;
    for (int i = 2; i <= n; i++) {
      dp[i][0] = dp[i - 1][0] + x * abs(a[i] - a[i - 1]);
      x *= -1;
    }
    x = 1;
    for (int i = 3; i <= n; i++) {
      dp[i][1] = dp[i - 1][1] + x * abs(a[i] - a[i - 1]);
      x *= -1;
    }
    long long ans = 0, mn = 0;
    for (int i = 2; i <= n; i++) {
      mn = min(mn, dp[i][0]);
      ans = max(ans, dp[i][0] - mn);
    }
    mn = 0;
    for (int i = 3; i <= n; i++) {
      mn = min(mn, dp[i][1]);
      ans = max(ans, dp[i][1] - mn);
    }
    cout << ans << endl;
  }
  return 0;
}
