#include <bits/stdc++.h>
using namespace std;
long long int a[100005], dp[100005][2], dpsol[100005];
void init() {
  memset(dp, -1, sizeof(dp));
  memset(dpsol, -1, sizeof(dpsol));
  return;
}
void maxm(long long int st, long long int en) {
  for (long long int i = en; i >= st; i--) {
    if (i == en) {
      dp[i][0] = dp[i][1] = 0;
    } else if (i == en - 1) {
      dp[i][0] = dp[i][1] = abs(a[i] - a[i + 1]);
    } else {
      long long int tmp = abs(a[i] - a[i + 1]);
      dp[i][0] = max(tmp, max(tmp - dp[i + 1][0], tmp - dp[i + 1][1]));
      dp[i][1] = min(tmp, min(tmp - dp[i + 1][0], tmp - dp[i + 1][1]));
    }
  }
  return;
}
void sol(long long int st, long long int en) {
  for (long long int i = en; i >= st; i--) {
    if (i == en) {
      dpsol[i] = 0;
    } else if (i == en - 1) {
      dpsol[i] = abs(a[i] - a[i + 1]);
    } else {
      dpsol[i] = max(dpsol[i + 1], max(dp[i][0], dp[i][1]));
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  init();
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  maxm(0, n - 1);
  sol(0, n - 1);
  cout << dpsol[0] << endl;
  return 0;
}
