#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  long long int N, ref, temp, maxAns = -1;
  const int max_size = 100005;
  array<array<long long int, 2>, max_size> dp;
  vector<long long int> diffs;
  cin >> N >> ref;
  for (int i = 0; i < N - 1; ++i) {
    cin >> temp;
    diffs.push_back(abs(temp - ref));
    ref = temp;
  }
  dp[0][0] = diffs[0];
  maxAns = diffs[0];
  for (int i = 1; i < N - 1; ++i) {
    if (i % 2) {
      dp[i][0] = max(dp[i - 1][0] - diffs[i], (long long int)0);
      dp[i][1] = dp[i - 1][1] + diffs[i];
    } else {
      dp[i][0] = dp[i - 1][0] + diffs[i];
      dp[i][1] = max(dp[i - 1][1] - diffs[i], (long long int)0);
    }
    maxAns = max(maxAns, max(dp[i][0], dp[i][1]));
  }
  cout << maxAns << "\n";
  return 0;
}
