#include <bits/stdc++.h>
using namespace std;
long long n, a1, a2, c, b, t, y, d;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> a1;
  while (--n) {
    cin >> a2;
    b = abs(a1 - a2);
    a1 = a2;
    t = c;
    c = max(b, d + b);
    y = max(y, c);
    d = t - b;
  }
  cout << y;
  return 0;
}
