#include <bits/stdc++.h>
using namespace std;
long long v[100005], dp[100005], Max;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i <= n - 1; i++) v[i] = abs(v[i] - v[i + 1]);
  n--;
  for (int i = 1; i <= n; i++) {
    dp[i] = v[i];
    if (i + 2 >= 3) dp[i] = max(dp[i], v[i] - v[i - 1] + dp[i - 2]);
    Max = max(Max, dp[i]);
  }
  cout << Max;
}
