#include <bits/stdc++.h>
using namespace std;
long long arr[100010];
long long maxSubArraySum(int st, int ed) {
  long long max_so_far = -10000000000, max_ending_here = 0;
  for (int i = st; i < ed; i++) {
    max_ending_here = max_ending_here + arr[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
long long tempArr[100010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &tempArr[i]);
  }
  vector<int> vec;
  for (int i = 0; i < n - 1; i++) {
    vec.push_back(llabs(tempArr[i] - tempArr[i + 1]));
  }
  long long ans;
  for (int i = 0; i < vec.size(); i++) {
    arr[i] = vec[i];
    if (i % 2 == 0) arr[i] *= -1;
  }
  ans = maxSubArraySum(0, n);
  for (int i = 0; i < vec.size(); i++) {
    arr[i] = vec[i];
    if (i % 2 == 1) arr[i] *= -1;
  }
  ans = max(ans, maxSubArraySum(0, n));
  cout << ans << "\n";
  return 0;
}
