#include <bits/stdc++.h>
using std::vector;
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  size_t array_size;
  std::cin >> array_size;
  vector<int64_t> array(array_size);
  for (auto& elem : array) {
    std::cin >> elem;
  }
  vector<int64_t> diffs;
  for (size_t i = 1; i < array.size(); ++i) {
    diffs.push_back(llabs(array[i] - array[i - 1]));
  }
  vector<int64_t> prefix_sums{0};
  for (auto elem : diffs) {
    if (prefix_sums.size() % 2 == 0) {
      prefix_sums.push_back(prefix_sums.back() - elem);
    } else {
      prefix_sums.push_back(prefix_sums.back() + elem);
    }
  }
  vector<size_t> min_pos, max_pos;
  for (size_t i = 0; i < prefix_sums.size(); ++i) {
    while (!min_pos.empty() && prefix_sums[min_pos.back()] >= prefix_sums[i]) {
      min_pos.pop_back();
    }
    while (!max_pos.empty() && prefix_sums[max_pos.back()] <= prefix_sums[i]) {
      max_pos.pop_back();
    }
    min_pos.push_back(i);
    max_pos.push_back(i);
  }
  int64_t best_way = 0;
  size_t min_pos_pos = 0, max_pos_pos = 0;
  for (size_t i = 0; i < prefix_sums.size(); ++i) {
    if (i > min_pos[min_pos_pos]) {
      ++min_pos_pos;
    }
    if (i > max_pos[max_pos_pos]) {
      ++max_pos_pos;
    }
    if (i % 2) {
      best_way = std::max(best_way, (-1) * (prefix_sums[min_pos[min_pos_pos]] -
                                            prefix_sums[i]));
    } else {
      best_way = std::max(best_way,
                          prefix_sums[max_pos[max_pos_pos]] - prefix_sums[i]);
    }
  }
  std::cout << best_way;
  return 0;
}
