#include <bits/stdc++.h>
using namespace std;
long long a[100010];
long long b[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    b[i] = abs(a[i] - a[i + 1]);
    if (i % 2 == 0) b[i] *= -1;
  }
  long long x = 0, ans = 0;
  for (int i = 1; i < n; i++) {
    x += b[i];
    ans = max(ans, x);
    if (x < 0) x = 0;
  }
  for (int i = 1; i < n; i++) b[i] *= -1;
  x = 0;
  long long temp = 0;
  for (int i = 1; i < n; i++) {
    x += b[i];
    temp = max(temp, x);
    if (x < 0) x = 0;
  }
  ans = max(ans, temp);
  cout << ans;
}
