#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
long long dp[2][N], a[N], f[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)n; i++) cin >> a[i];
  f[0] = abs(a[0] - a[1]);
  for (int i = 1; i < (int)n - 1; i++) {
    f[i] = abs(a[i] - a[i + 1]);
  }
  dp[0][0] = f[0];
  dp[1][0] = -1 << 31;
  for (int i = 1; i < (int)n - 1; i++) {
    dp[0][i] = max(0LL, dp[1][i - 1]) + f[i];
    dp[1][i] = max(0LL, dp[0][i - 1]) - f[i];
  }
  cout << max(*max_element(dp[0], dp[0] + n - 1),
              *max_element(dp[1], dp[1] + n - 1))
       << "\n";
}
