#include <bits/stdc++.h>
const int MAX = 100005;
int main() {
  long long a[MAX], dp[MAX][2];
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i < n; i++) {
    a[i] = abs(a[i] - a[i + 1]);
  }
  dp[1][1] = a[1];
  dp[1][0] = 0;
  long long ans = a[1];
  for (int i = 2; i < n; i++) {
    if (i % 2) {
      dp[i][0] = dp[i - 1][0] - a[i];
      dp[i][1] =
          (((a[i]) > (dp[i - 1][1] + a[i])) ? (a[i]) : (dp[i - 1][1] + a[i]));
      ans = (((ans) > ((((dp[i][0]) > (dp[i][1])) ? (dp[i][0]) : (dp[i][1]))))
                 ? (ans)
                 : ((((dp[i][0]) > (dp[i][1])) ? (dp[i][0]) : (dp[i][1]))));
    } else {
      dp[i][0] =
          (((a[i]) > (dp[i - 1][0] + a[i])) ? (a[i]) : (dp[i - 1][0] + a[i]));
      dp[i][1] = dp[i - 1][1] - a[i];
      ans = (((ans) > ((((dp[i][0]) > (dp[i][1])) ? (dp[i][0]) : (dp[i][1]))))
                 ? (ans)
                 : ((((dp[i][0]) > (dp[i][1])) ? (dp[i][0]) : (dp[i][1]))));
    }
  }
  printf("%lld\n", ans);
  return 0;
}
