#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int* arr = new int[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int* dp1 = new int[n];
  for (int i = 1; i < n; i++) dp1[i] = abs(arr[i - 1] - arr[i]);
  long long* dp2 = new long long[n];
  dp2[0] = 0;
  for (int i = 1; i < n; i++) {
    if (i % 2 == 1)
      dp2[i] = dp2[i - 1] + dp1[i];
    else
      dp2[i] = dp2[i - 1] - dp1[i];
  }
  long long min = 0, max = -1;
  for (int i = 1; i < n; i++) {
    if (min > dp2[i]) min = dp2[i];
    if (max < dp2[i]) max = dp2[i];
  }
  cout << abs(max - min);
  return 0;
}
