#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<long long> vec(n + 1);
  for (int i = 1; i <= n; i++) cin >> vec[i];
  vector<long long> a;
  for (int i = 1; i < n; i++) {
    if (i & 1)
      a.push_back(abs(vec[i] - vec[i + 1]));
    else
      a.push_back(-1 * abs(vec[i] - vec[i + 1]));
  }
  vector<long long> dp((int)a.size());
  dp[0] = a[0];
  long long res = dp[0];
  for (int i = 1; i < dp.size(); i++) {
    dp[i] = max(a[i], dp[i - 1] + a[i]);
    res = max(res, dp[i]);
  }
  dp.clear();
  a.clear();
  for (int i = 1; i < n; i++) {
    if (!(i & 1))
      a.push_back(abs(vec[i] - vec[i + 1]));
    else
      a.push_back(-1 * abs(vec[i] - vec[i + 1]));
  }
  dp = vector<long long>((int)a.size());
  dp[0] = a[0];
  long long res2 = dp[0];
  for (int i = 1; i < dp.size(); i++) {
    dp[i] = max(a[i], dp[i - 1] + a[i]);
    res2 = max(res2, dp[i]);
  }
  cout << max(res, res2) << '\n';
  return 0;
}
