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