#include <bits/stdc++.h>
using namespace std;
using ld = long double;
int t[102], low[102], high[102];
using ull = unsigned long long;
int mod = pow(10, 9) + 7;
long long int arr[200009], val[200009], ans[200009];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i < n; i++) val[i] = abs(arr[i] - arr[i + 1]);
  ans[1] = val[1];
  long long int res = ans[1];
  for (int i = 2; i < n; i++) {
    long long int tmp = val[i] - val[i - 1] + ans[i - 2];
    ans[i] = max(val[i], tmp);
    res = max(res, ans[i]);
  }
  cout << res;
  return 0;
}
