#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, i, sum1, sum2, dummy;
  cin >> n;
  vector<long long int> v, dp;
  for (i = 0; i < n; i++) {
    cin >> k;
    v.push_back(k);
  }
  for (i = 0; i < n - 1; i++)
    if (i % 2 == 0)
      dp.push_back(fabs(v[i] - v[i + 1]));
    else
      dp.push_back(-fabs(v[i] - v[i + 1]));
  v.clear();
  sum1 = dp[0];
  dummy = dp[0];
  for (i = 1; i < n - 1; i++) {
    dummy = fmax(dummy + dp[i], dp[i]);
    sum1 = fmax(sum1, dummy);
  }
  for (i = 0; i < n - 1; i++) dp[i] = -dp[i];
  sum2 = dp[0];
  dummy = dp[0];
  for (i = 1; i < n - 1; i++) {
    dummy = fmax(dummy + dp[i], dp[i]);
    sum2 = fmax(sum2, dummy);
  }
  cout << (long long int)fmax(sum1, sum2);
}
