#include <bits/stdc++.h>
using namespace std;
long long st[100005];
bool binSearch(long long beg, long long end, long long num) {
  if (beg == end) {
    if (st[beg] == num)
      return true;
    else
      return false;
  }
  if (binSearch(beg, (beg + end) / 2, num))
    return true;
  else if (binSearch((beg + end) / 2 + 1, end, num))
    return true;
  else
    return false;
}
int main() {
  long long n;
  cin >> n;
  long long st2[100005];
  long long sumarr[100005];
  long long sumend[100005];
  long long sum = 0, ans = 0;
  long long summin2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> st[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (i % 2 == 0)
      st2[i] = abs(st[i] - st[i + 1]);
    else
      st2[i] = -abs(st[i] - st[i + 1]);
  }
  sum = 0;
  for (int r = 0; r < n - 1; ++r) {
    summin2 += st2[r];
    sum = max(sum, summin2);
    summin2 = max(summin2, (long long)0);
  }
  ans = sum;
  for (int i = 0; i < n - 1; i++) {
    if (i % 2 == 0)
      st2[i] = -abs(st[i] - st[i + 1]);
    else
      st2[i] = abs(st[i] - st[i + 1]);
  }
  sum = 0;
  summin2 = 0;
  for (int r = 0; r < n - 1; ++r) {
    summin2 += st2[r];
    sum = max(sum, summin2);
    summin2 = max(summin2, (long long)0);
  }
  ans = max(ans, sum);
  cout << ans;
  return 0;
}
