#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int POWER[65];
void precompute() {
  POWER[0] = 1;
  for (int i = 1; i < 31; i++) POWER[i] = POWER[i - 1] << 1LL;
}
long long int power(long long int x, long long int y, long long int mod) {
  long long int res = 1;
  x %= mod;
  while (y) {
    if (y & 1) res = (res * x) % mod;
    y >>= 1;
    x = (x * x) % mod;
  }
  return res;
}
bool vis[200005] = {false};
vector<long long int> v[200005];
vector<long long int> vec;
long long int dis[2000005] = {0};
long long int a, b, c;
set<long long int> st;
long long int f[200005] = {0};
map<pair<long long int, long long int>, long long int> m;
long long int maxSubArraySum(long long int a[], long long int size) {
  long long int max_so_far = INT_MIN, max_ending_here = 0;
  for (long long int i = 0; i < size; i++) {
    max_ending_here = max_ending_here + a[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;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int neg[n - 1];
  long long int pos[n - 1];
  for (long long int i = 0; i < n - 1; i++) {
    if (i % 2 == 0) {
      neg[i] = -1 * (abs(arr[i] - arr[i + 1]));
      pos[i] = (abs(arr[i] - arr[i + 1]));
    } else {
      neg[i] = (abs(arr[i] - arr[i + 1]));
      pos[i] = -1 * (abs(arr[i] - arr[i + 1]));
    }
  }
  cout << max(maxSubArraySum(neg, n - 1), maxSubArraySum(pos, n - 1));
  return 0;
}
