import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;
import std.datetime;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!long).array;
    auto B = new long[](N-1);
    foreach (i; 0..N-1) {
        B[i] = abs(A[i] - A[i+1]);
    }


    long ans = B[0];
    long tmp = B[0];
    foreach (i; 1..N-1) {
        tmp += (i % 2 == 0) ? B[i] : -B[i];
        ans = max(ans, tmp);
        if (tmp < 0) tmp = 0;
    }

    if (N <= 2) {
        ans.writeln;
        return;
    }


    ans = max(ans, B[1]);
    tmp = B[1];
    foreach (i; 2..N-1) {
        tmp += (i % 2 == 1) ? B[i] : -B[i];
        ans = max(ans, tmp);
        if (tmp < 0) tmp = 0;
    }

    ans.writeln;
}
