#include <bits/stdc++.h>
using namespace std;
long long n, m, f[1000100][2], a[1000100], c[1000100], ans;
inline int getint() {
  int w = 0, q = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 1, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? -w : w;
}
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) c[i] = getint();
  for (long long i = 1; i < n; i++) a[i] = abs(c[i + 1] - c[i]);
  n--;
  for (long long i = 1; i <= n; i++) {
    f[i][0] = max((long long)0, f[i - 1][1] - a[i]);
    f[i][1] = f[i - 1][0] + a[i];
    ans = max(ans, max(f[i][0], f[i][1]));
  }
  cout << ans;
  return 0;
}
