#include <bits/stdc++.h>
using namespace std;
int B, Q, L, N;
int angka[100006];
long long act[2][100006];
int main() {
  scanf("%d", &N);
  ;
  for (int i = 0; i < N; i++) {
    scanf("%d", &angka[i]);
    ;
  }
  int kagi = 1;
  int kagi2 = -1;
  for (int i = 0; i < N - 1; i++) {
    act[0][i] = abs(angka[i] - angka[i + 1]) * kagi;
    act[1][i] = abs(angka[i] - angka[i + 1]) * kagi2;
    kagi *= -1;
    kagi2 *= -1;
  }
  long long res = -1;
  long long tmp = 0;
  for (int i = 0; i < N - 1; i++) {
    tmp += act[0][i];
    if (tmp < 0) {
      tmp = 0;
    }
    if (res < tmp) res = tmp;
  }
  tmp = 0;
  for (int i = 1; i < N - 1; i++) {
    tmp += act[1][i];
    if (tmp < 0) {
      tmp = 0;
    }
    if (res < tmp) res = tmp;
  }
  cout << res << endl;
}
