#include <bits/stdc++.h>
using namespace std;
long long N, A[100005];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> N;
  for (int i = int(1); i < int(N + 1); i++) cin >> A[i];
  long long best = 0, acc = 0;
  for (int i = int(1); i < int(N); i++) {
    acc += abs(A[i] - A[i + 1]) * (i % 2 == 1 ? 1 : -1);
    if (acc > best) best = acc;
    if (acc < 0) acc = 0;
  }
  acc = 0;
  for (int i = int(2); i < int(N); i++) {
    acc += abs(A[i] - A[i + 1]) * (i % 2 == 0 ? 1 : -1);
    if (acc > best) best = acc;
    if (acc < 0) acc = 0;
  }
  cout << best << '\n';
  return 0;
}
