#include <bits/stdc++.h>
using namespace std;
int n;
long long a[100100];
long long b[100100];
long long c[100100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) {
    b[i] = abs(a[i] - a[i + 1]);
    c[i] = abs(a[i] - a[i + 1]);
  }
  for (int i = 1; i < n; i++) {
    if (i % 2 == 1) b[i] *= -1;
    if (i % 2 == 0) c[i] *= -1;
  }
  long long cnt = 0;
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    cnt += b[i];
    ans = max(cnt, ans);
    cnt = max(0 * 1ll, cnt);
  }
  cnt = 0;
  for (int i = 1; i < n; i++) {
    cnt += c[i];
    ans = max(cnt, ans);
    cnt = max(0 * 1ll, cnt);
  }
  cout << ans;
}
