#include <bits/stdc++.h>
using namespace std;
int n, b[100004], c[100004], a[100003];
long long res1, res2, sum1, sum2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    if (i & 1)
      b[i] = abs(a[i] - a[i + 1]), c[i] = -1 * abs(a[i] - a[i + 1]);
    else
      b[i] = -1 * abs(a[i] - a[i + 1]), c[i] = abs(a[i] - a[i + 1]);
    sum1 += b[i];
    res1 = max(sum1, res1);
    sum1 = max(sum1, 0ll);
    sum2 += c[i];
    res2 = max(sum2, res2);
    sum2 = max(sum2, 0ll);
  }
  cout << max(res1, res2);
}
