#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long arr[N], odd[N], even[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &arr[i]);
  for (int i = 1; i < n; i++) {
    odd[i] = abs(arr[i] - arr[i + 1]) * pow(-1, i - 1);
    even[i] = odd[i] * -1;
  }
  long long mx = 0;
  long long cur = 0;
  for (int i = 1; i < n; i++) {
    cur = max(even[i], even[i] + cur);
    mx = max(mx, cur);
  }
  cur = 0;
  for (int i = 1; i < n; i++) {
    cur = max(odd[i], odd[i] + cur);
    mx = max(mx, cur);
  }
  cout << mx << endl;
  return 0;
}
