#include <bits/stdc++.h>
using namespace std;
long long num[100005];
int main() {
  long long n, mx = 0, mn = 0, sum = 0;
  scanf("%lld %lld", &n, &num[1]);
  for (long long i = 2; i <= n; i++) {
    scanf("%lld", &num[i]);
    if (i % 2)
      sum += abs(num[i] - num[i - 1]);
    else
      sum -= abs(num[i] - num[i - 1]);
    mx = max(sum, mx);
    mn = min(mn, sum);
  }
  cout << mx - mn << endl;
}
