#include <bits/stdc++.h>
using namespace std;
long long int maxsum(vector<long long int> a) {
  long long int max_so_far = -1000000000000, max_ending_here = 0;
  for (int i = 0; i < a.size(); i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
int main() {
  int n;
  cin >> n;
  vector<long long int> v;
  for (int i = 0; i < n; i++) {
    long long int temp = 0;
    cin >> temp;
    v.push_back(temp);
  }
  vector<long long int> temp1, temp2;
  int j = 0, m = 0;
  for (int i = 1; i < v.size(); i++) {
    temp1.push_back(abs(v[i] - v[i - 1]));
    temp2.push_back(abs(v[i] - v[i - 1]));
  }
  for (int i = 0; i < temp1.size(); i++) {
    if (i % 2 == 0)
      temp1[i] = temp1[i] * -1;
    else
      temp2[i] = temp2[i] * -1;
  }
  cout << max(maxsum(temp1), maxsum(temp2)) << "\n";
}
