#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n], b[n], c[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < -1 + n; i++) {
    b[i] = abs(a[i] - a[i + 1]);
    if (i & 1) b[i] *= -1;
    c[i] = b[i] * -1;
  }
  long long ms = -2e9 - 1, rs = 0;
  for (int i = 0; i < n - 1; i++) {
    rs += b[i];
    if (rs > ms) ms = rs;
    if (rs < 0) rs = 0;
  }
  rs = 0;
  for (int i = 0; i < n - 1; i++) {
    rs += c[i];
    if (rs > ms) ms = rs;
    if (rs < 0) rs = 0;
  }
  cout << ms << endl;
}
