#include <iostream>
#include <random>
#include <chrono>
#include <algorithm>
#define rep(i, x) for(int i = 0; i < x; i++)
using namespace std;
typedef long long ll;
ll MOD = (ll)1e9 + 7;
const int N = 1e5+5, inf = 1e9+5;
ll add(ll x, ll y) { x += y; if (x >= MOD) return x - MOD; return x; }
ll sub(ll x, ll y) { x -= y; if (x < 0) return x + MOD; return x; }
ll mult(ll x, ll y) { return (x * y) % MOD; }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    int n; cin >> n;
    vector<ll> a(n), dp(n);
    rep (i, n) cin >> a[i];

    vector<ll> b;
    for (int i = 0; i < n-1; ++i) b.push_back(abs(a[i+1]-a[i]));

    ll best = 0;
    for (int sign = 0; sign <= 1; ++sign) {
        dp[0] = b[0]*(sign==0?1:-1);
        for (int i = 1; i < n-1; ++i) {
            ll curr = b[i]*(((i+sign)&1)==0?1:-1);
            dp[i] = max(dp[i-1] + curr, curr);
            best = max(best, dp[i]);
        }
    }
    cout << best << endl;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;

int main(){

    //Functions again

    int n;

    cin>>n;

    int i, a[n+1];

    for (i=1;i<=n;i++){
        cin>>a[i];
    }

    int x=1, func[n];

    func[0]=0;

    for (i=1;i<=n-1;i++){
        func[i]=func[i-1]+abs(a[i]-a[i+1])*x;
        x*=-1;
    }

    int l=1, r=n-1, ans=func[n-1];

    while (l<=r){
        int L=func[l];
        int R=func[n-1]-func[r];
        (L>R ? l++ : r--);
        ans=max(ans, max(L, R));
    }

    cout<<ans<<'\n';

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <algorithm>

typedef long long ll;

using namespace std;

int main(){

    //Functions again

    ll n;

    cin>>n;

    ll i, a[n+1];

    for (i=1;i<=n;i++){
        cin>>a[i];
    }

    ll f[n+1];

    for (i=1;i<n;i++){
        f[i]=abs(a[i]-a[i+1]);
    }

    ll dp[n][2], ans=f[1];

    dp[1][1]=f[1];
    dp[1][0]=0;

    for (i=2;i<n;i++){
        if (i%2==1){
            dp[i][0]=dp[i-1][0]-f[i];
            dp[i][1]=max(f[i], dp[i-1][1]+f[i]);
        }
        else {
            dp[i][0]=max(f[i], dp[i-1][0]+f[i]);
            dp[i][1]=dp[i-1][1]-f[i];
        }
        ans=max(ans, max(dp[i][0], dp[i][1]));
    }

    cout<<ans<<'\n';

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <algorithm>

typedef long long ll;

using namespace std;

int main(){

    //Functions again

    ll n;

    cin>>n;

    ll i, a[n+1];

    for (i=1;i<=n;i++){
        cin>>a[i];
    }

    ll x=1, func[n], ans=-1;

    func[0]=0;

    for (i=1;i<=n-1;i++){
        func[i]=func[i-1]+abs(a[i]-a[i+1])*x;
        x*=-1;
        ans=max(ans, func[i]);
    }

    ll j;

    for (i=1;i<=n-1;i++){
        for (j=i;j<=n-1;j++){
            ll y;
            y=(i%2==1 ? 1 : -1);
            ans=max(ans, (func[j]-func[i-1])*y);
        }
    }

    cout<<ans<<'\n';

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <algorithm>

typedef long long ll;

using namespace std;

int main(){

    //Functions again

    ll n;

    cin>>n;

    ll i, a[n+1];

    for (i=1;i<=n;i++){
        cin>>a[i];
    }

    ll x=1, func[n], ans=-1;

    func[0]=0;

    for (i=1;i<=n-1;i++){
        func[i]=func[i-1]+abs(a[i]-a[i+1])*x;
        x*=-1;
        ans=max(ans, func[i]);
    }

    ll j;

    for (i=1;i<=n-2;i++){
        for (j=i+1;j<=n-1;j++){
            ll y;
            y=(i%2==1 ? 1 : -1);
            ans=max(ans, (func[j]-func[i-1])*y);
        }
    }

    cout<<ans<<'\n';

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){

    //Functions again

    ll n;

    cin>>n;

    ll i, a[n+1];

    for (i=1;i<=n;i++){
        cin>>a[i];
    }

    ll x=1, func[n], ans=-1;

    func[0]=0;

    for (i=1;i<=n-1;i++){
        func[i]=func[i-1]+abs(a[i]-a[i+1])*x;
        x*=-1;
        ans=max(ans, func[i]);
    }

    ll j;

    for (i=1;i<=n-2;i++){
        for (j=i+1;j<=n-1;j++){
            ll y;
            y=(i%2==1 ? 1 : -1);
            ans=max(ans, (func[j]-func[i-1])*y);
        }
    }

    cout<<ans<<'\n';

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n,nax=0;
    cin>>n;
    ll a[n],a2[n-1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];

    }
    for(int i=1;i<n;i++)
    {
    a2[i-1]=abs(a[i]-a[i-1]);
    if(nax<a2[i-1])
        nax=a2[i-1];
    }
    for(int i=0;i<n-1;i++)
    cout<<a2[i]<<" ";
    cout<<endl;
    ll sum=a2[0],temp=0;
    for(int i=1;i<n-1;i+=2)
    {

        temp=(ll)(i+1<n-1?-a2[i]+a2[i+1]:0);

        if(temp>0)
        sum+=temp;
        else
        sum=0;
        cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
        cout<<nax<<endl;
    }
    cout<<nax<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n,nax=0;
    cin>>n;
    ll a[n],a2[n-1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];

    }
    for(int i=1;i<n;i++)
    {
    a2[i-1]=abs(a[i]-a[i-1]);
    if(nax<a2[i-1])
        nax=a2[i-1];
    }
    /*for(int i=0;i<n-1;i++)
    cout<<a2[i]<<" ";
    cout<<endl;*/
    ll sum=a2[0],temp=0;
    for(int i=1;i<n-1;i+=2)
    {

        temp=(ll)(i+1<n-1?-a2[i]+a2[i+1]:0);

        if(temp>0)
        sum+=temp;
        else
        sum=0;
        //cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
        //cout<<nax<<endl;
    }
    cout<<nax<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n,nax=0,nax3=0;
    cin>>n;
    ll a[n],a2[n-1],a3[n-1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];

    }
    for(int i=1;i<n;i++)
    {
    a2[i-1]=abs(a[i]-a[i-1])*pow(-1,i-1);
    if(nax<a2[i-1])
        nax=a2[i-1];
    }
    for(int i=0;i<n-1;i++)
    {
    a3[i]=abs(a[i+1]-a[i])*pow(-1,i-1);
    if(nax3<a3[i])
        nax3=a3[i];
    }
    /*for(int i=0;i<n-1;i++)
    cout<<a2[i]<<" ";
    cout<<endl;*/
    ll sum=0,temp=0;
    for(int i=0;i<n-1;i++)
    {

        sum+=a2[i];
        if(sum<0)
        sum=0;
        //cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
        //cout<<nax<<endl;
    }
    a3[0]=0;
    sum=a3[0];temp=0;
    for(int i=0;i<n-1;i++)
    {

        sum+=a3[i];
        if(sum<0)
        sum=0;
        //cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
        //cout<<nax<<endl;
    }
    cout<<nax<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n,nax=0,nax3=0;
    cin>>n;
    ll a[n],a2[n-1],a3[n-1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];

    }
    for(int i=1;i<n;i++)
    {
    a2[i-1]=abs(a[i]-a[i-1])*pow(-1,i-1);
    if(nax<a2[i-1])
        nax=a2[i-1];
    }
    for(int i=1;i<n-1;i++)
    {
    a3[i-1]=abs(a[i+1]-a[i])*pow(-1,i-1);
    if(nax3<a3[i-1])
        nax3=a3[i-1];
    }
    /*for(int i=0;i<n-1;i++)
    cout<<a2[i]<<" ";
    cout<<endl;*/
    ll sum=a2[0],temp=0;
    for(int i=1;i<n-1;i++)
    {

        sum+=a2[i];
        if(sum<0)
        sum=0;
        //cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
        //cout<<nax<<endl;
    }

    sum=a3[0];temp=0;
    for(int i=1;i<n-2;i++)
    {

        sum+=a3[i];
        if(sum<0)
        sum=0;
        //cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
        //cout<<nax<<endl;
    }
    cout<<nax<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n,nax=0;
    cin>>n;
    ll a[n],a2[n-1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];

    }
    for(int i=1;i<n;i++)
    {
    a2[i-1]=abs(a[i]-a[i-1]);
    if(nax<a2[i-1])
        nax=a2[i-1];
    }
    ll sum=0,temp=0;
    for(int i=1;i<n-1;i+=2)
    {

        temp=a2[i-1]+(ll)(i+1<n-1?-a2[i]+a2[i+1]:0);
        //cout<<temp<<" "<<i<<endl;
        if(temp>0)
        sum+=temp;
        else
        sum=0;
        nax=max(nax,sum);
        //cout<<nax<<endl;
    }
    cout<<nax<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n,nax=0,nax3=0;
    cin>>n;
    ll a[n],a2[n-1],a3[n-1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];

    }
    for(int i=1;i<n;i++)
    {
    a2[i-1]=abs(a[i]-a[i-1])*pow(-1,i-1);
    if(nax<a2[i-1])
        nax=a2[i-1];
    }
    for(int i=0;i<n;i++)
    {
    a3[i]=abs(a[i+1]-a[i])*pow(-1,i-1);
    if(nax3<a3[i-1])
        nax3=a3[i-1];
    }
    /*for(int i=0;i<n-1;i++)
    cout<<a2[i]<<" ";
    cout<<endl;*/
    ll sum=a2[0],temp=0;
    for(int i=0;i<n-1;i++)
    {

        sum+=a2[i];
        if(sum<0)
        sum=0;
        //cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
       // cout<<nax<<endl;
    }
    a3[0]=0;
    sum=a3[0];temp=0;
    for(int i=0;i<n-1;i++)
    {

        sum+=a3[i];
        if(sum<0)
        sum=0;
        //cout<<temp<<" "<<sum<<" "<<i<<endl;
        nax=max(nax,sum);
        //cout<<nax<<endl;
    }
    cout<<nax<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	cin>>a[i];
	ll b[n-1], c[n-1];
	for(ll i=0;i<n-1;i++)
	{
		b[i]=(abs(a[i]-a[i+1])*(pow(-1, i)));
		c[i]=(abs(a[i]-a[i+1])*pow(-1, i+1));
	}
	//cout<<"HERE" <<endl;
	ll maxx=0, i=0, j=0, sum=0;
	while(i<n-1&&j<n-1)
	{
		sum+=b[i];
		i++;
		 if(sum<0)
		{
			while(sum<0&&j<n-1) {
				sum-=b[j++];
			}
		}
		maxx=max(sum, maxx);
	}
	i=0, j=0, sum=0;
	while(i<n-1&&j<n-1)
	{
		sum+=c[i];
		i++;
		if(sum<0)
		{
			while(sum<0&&j<n-1) {
				sum-=c[j++];
			}
		}
		maxx=max(sum, maxx);
	}
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	cin>>a[i];
	ll b[n-1], c[n-1], prb[n]={0}, prc[n]={0}, maxx=0;
	for(ll i=0;i<n-1;i++)
	{
		b[i]=(abs(a[i]-a[i+1])*(pow(-1, i)));
		prb[i+1]=prb[i]+b[i];
		if(prb[i+1]<0)
		prb[i+1]=0;
		maxx=max(maxx,prb[i+1]);
		c[i]=(abs(a[i]-a[i+1])*pow(-1, i+1));
		prc[i+1]=prc[i]+c[i];
		if(prc[i+1]<0)
		prc[i+1]=0;
		maxx=max(maxx, prc[i+1]);
	}
	cout<<maxx<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	cin>>a[i];
	ll b[n-1], c[n-1];
	for(ll i=0;i<n-1;i++)
	{
		b[i]=(abs(a[i]-a[i+1])*(pow(-1, i)));
		c[i]=(abs(a[i]-a[i+1])*pow(-1, i+1));
	}
	//cout<<"HERE" <<endl;
	ll maxx=0, i=0, j=0, sum=0;
	while(i<n-1&&j<n-1)
	{
		sum+=b[i];
		i++;
		//cout<<sum<<endl;
		 if(sum<0)
		{
			while(sum<0&&j<n-1) {
				sum-=b[j++];
				//cout<<"Here"<<endl;
			}
			if(j%2==1&&j!=n-1)
			sum-=b[j++];
			cout<<sum<<endl;
		}
		//cout<<sum<<endl;
		maxx=max(sum, maxx);
		//cout<<maxx<<endl;
	}
	//cout<<"fuck"<<endl;
	i=0, j=0, sum=0;
	while(i<n-1&&j<n-1)
	{
		sum+=c[i];
		if(sum<0)
		{
			while(sum<0&&j<n-1) {
				sum-=b[j++];
			}
			if(j%2==0&&j!=n-1)
			sum-=b[j++];
		}
		maxx=max(sum, maxx);
	}
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	cin>>a[i];
	ll b[n-1], c[n-1], prb[n]={0}, prc[n]={0}, maxx=0;
	for(ll i=0;i<n-1;i++)
	{
		b[i]=(abs(a[i]-a[i+1])*(pow(-1, i)));
		prb[i+1]=prb[i]+b[i];
		if(prb[i+1]<0)
		prb[i+1]=0;
		maxx=max(maxx,prb[i+1]);
		c[i]=(abs(a[i]-a[i+1])*pow(-1, i+1));
		prc[i+1]=prc[i]+c[i];
		if(prc[i]<0)
		prc[i]=0;
		maxx=max(maxx, prc[i+1]);
	}
	cout<<maxx<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll n;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	cin>>a[i];
	ll b[n-1], c[n-1];
	for(ll i=0;i<n-1;i++)
	{
		b[i]=(abs(a[i]-a[i+1])*(pow(-1, i)));
		c[i]=(abs(a[i]-a[i+1])*pow(-1, i+1));
	}
	//cout<<"HERE" <<endl;
	ll maxx=0, i=0, j=0, sum=0;
	while(i<n-1&&j<n-1)
	{
		sum+=b[i];
		i++;
		//cout<<sum<<endl;
		 if(sum<0)
		{
			while(sum<0&&j<n-1) {
				sum-=b[j++];
				//cout<<"Here"<<endl;
			}
			if(j%2==1&&j!=n-1)
			sum-=b[j++];
			cout<<sum<<endl;
		}
		//cout<<sum<<endl;
		maxx=max(sum, maxx);
	}
	i=0, j=0, sum=0;
	while(i<n-1&&j<n-1)
	{
		sum+=c[i];
		i++;
		if(sum<0)
		{
			while(sum<0&&j<n-1) {
				sum-=b[j++];
			}
			if(j%2==0&&j!=n-1)
			sum-=b[j++];
		}
		maxx=max(sum, maxx);
	}
	cout<<maxx<<endl;
}


#include <bits/stdc++.h>

using namespace std;

#define ld long double
#define ll long long

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
    srand(time(0));

    int n;cin>>n;
    vector<ll> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    vector<ll> a,b;
    int c = 1;
    for(int i=0;i<n-1;i++){
        a.push_back(abs(v[i] - v[i + 1]) * c);
        b.push_back(abs(v[i] - v[i + 1]) * -c);
        c = -c;
    }
    /*for(auto x:a){
        cout<<x<<" ";
    }
    cout<<endl;
    for(auto x:b){
        cout<<x<<" ";
    }*/
    int sum = 0, ans = 0;
    for(auto x:a){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    sum = 0;
    for(auto x:b){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    cout<<ans;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ld long double
#define ll long long

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
    srand(time(0));

    int n;cin>>n;
    vector<ll> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    vector<ll> a,b;
    int c = 1;
    for(int i=0;i<n-1;i++){
        a.push_back(abs(v[i] - v[i + 1]) * c);
        /*if(i != 0)*/b.push_back(abs(v[i] - v[i + 1]) * -c);
        c = -c;
    }
    /*for(auto x:a){
        cout<<x<<" ";
    }
    cout<<endl;
    for(auto x:b){
        cout<<x<<" ";
    }*/
    ll sum = 0, ans = 0;
    for(auto x:a){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    sum = 0;
    for(auto x:b){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    cout<<ans;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ld long double
#define ll long long

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
    srand(time(0));

    int n;cin>>n;
    vector<ll> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    vector<ll> a,b;
    int c = 1;
    for(int i=0;i<n-1;i++){
        a.push_back(abs(v[i] - v[i + 1]) * c);
        if(i != 0)b.push_back(abs(v[i] - v[i + 1]) * -c);
        c = -c;
    }
    /*for(auto x:a){
        cout<<x<<" ";
    }
    cout<<endl;
    for(auto x:b){
        cout<<x<<" ";
    }*/
    int sum = 0, ans = 0;
    for(auto x:a){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    sum = 0;
    for(auto x:b){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    cout<<ans;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ld long double
#define ll long long

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
    srand(time(0));

    int n;cin>>n;
    vector<ll> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    vector<ll> a,b;
    int c = 1;
    for(int i=0;i<n-1;i++){
        a.push_back(abs(v[i] - v[i + 1]) * c);
        if(i != 0)b.push_back(abs(v[i] - v[i + 1]) * -c);
        c = -c;
    }
    /*for(auto x:a){
        cout<<x<<" ";
    }
    cout<<endl;
    for(auto x:b){
        cout<<x<<" ";
    }*/
    ll sum = 0, ans = 0;
    for(auto x:a){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    sum = 0;
    for(auto x:b){
        sum = max(sum + x, x);
        ans = max(ans, sum);
    }
    cout<<ans;

    return 0;
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 2e18;
using namespace std;

int n;
long long ar[100001];
long long dp[100001][2];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	long long &Ans = dp[i][ind];
	if( Ans != -1 )return Ans;
	if( ind ){
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) , abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1));
	}
	else{
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
	return Ans;
}

int main(){
	hitAi;
	memset(dp , -1 , sizeof(dp));
	cin >> n;
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	cout << f(0 , 0 , 0); // sum , i , flag
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 2e18;
using namespace std;

int n;
long long ar[100001];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	if( ind ){
		return max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) , abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1));
	}
	else{
		return max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
}

int main(){
	hitAi;
	cin >> n;
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	cout << f(0 , 0 , 0); // sum , i , flag
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 5e18;
using namespace std;

int n;
long long ar[100001];
long long dp[100001][2][2];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	long long &Ans = dp[i][ind][flag];
	if( Ans != -OO )return Ans;
	if( ind ){
		Ans = max( abs(ar[i]-ar[i+1]) * 1LL * (long long)pow(-1 , flag) , abs(ar[i]-ar[i+1]) * 1LL* (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1));
	}
	else{
		Ans = max( abs(ar[i]-ar[i+1]) * 1LL * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
	return Ans;
}

int main(){
	hitAi;
	cin >> n;
	for( int i = 0; i <= n; i++ ){
		dp[i][0][0] = dp[i][1][0] = -OO;
		dp[i][0][1] = dp[i][1][1] = -OO;
	}
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	cout << f(0 , 0 , 0); // sum , i , flag
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 2e18;
using namespace std;

int n;
long long ar[100001];
long long dp[100001][2];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	long long &Ans = dp[i][ind];
	if( Ans != OO )return Ans;
	if( ind ){
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) , abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1));
	}
	else{
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
	return Ans;
}

int main(){
	hitAi;
	cin >> n;
	for( int i = 0; i <= n; i++ ){
		dp[i][0] = dp[i][1] = OO;
	}
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	cout << f(0 , 0 , 0); // sum , i , flag
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 2e18;
using namespace std;

int n;
long long ar[100001];
long long dp[100001][2];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	long long &Ans = dp[i][ind];
	if( Ans != -1 )return Ans;
	if( ind ){
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) , abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1));
	}
	else{
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
	return Ans;
}

int main(){
	hitAi;
	memset(dp , -1 , sizeof(dp));
	cin >> n;
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	cout << f(0 , 0 , 0); // sum flag
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 2e18;
using namespace std;

int n;
long long ar[100001];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	if( ind ){
		return abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1);
	}
	else{
		return max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
}

int main(){
	hitAi;
	cin >> n;
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	cout << f(0 , 0 , 0); // sum , i , flag
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 2e18;
using namespace std;

int n;
long long ar[100001];
long long dp[100001][2][2];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	long long &Ans = dp[i][ind][flag];
	if( Ans != -OO )return Ans;
	if( ind ){
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) , abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1));
	}
	else{
		Ans = max( abs(ar[i]-ar[i+1]) * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
	return Ans;
}

int main(){
	hitAi;
	cin >> n;
	for( int i = 0; i <= n; i++ ){
		dp[i][0][0] = dp[i][1][0] = -OO;
		dp[i][0][1] = dp[i][1][1] = -OO;
	}
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	cout << f(0 , 0 , 0); // sum , i , flag
}


#define watch2(x , y) cout << (#x) << " " << (#y)<< " is " << (x) << " " << (y)<< endl
#define watch(x) cout << (#x) << " is " << (x) << endl
#define hitAi ios_base::sync_with_stdio(false)
#include<bits/stdc++.h>
#define Mod 1000000007
const long long OO = 5e18;
using namespace std;

int n;
long long ar[100005];
long long dp[100005][2][2];

long long f( int i , int flag , int ind ){
	if( i == n - 1 )return 0;
	long long &Ans = dp[i][ind][flag];
	if( Ans != -OO )return Ans;
	if( ind ){
		Ans = max( abs(ar[i]-ar[i+1]) * 1LL * (long long)pow(-1 , flag) , abs(ar[i]-ar[i+1]) * 1LL* (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1));
	}
	else{
		Ans = max( abs(ar[i]-ar[i+1]) * 1LL * (long long)pow(-1 , flag) + f( i+1 , 1-flag , 1) , f(i+1 , flag , 0));
	}
	return Ans;
}

int main(){
	hitAi;
	cin >> n;
	for( int i = 0; i <= n; i++ ){
		dp[i][0][0] = dp[i][1][0] = -OO;
		dp[i][0][1] = dp[i][1][1] = -OO;
	}
	for( int i = 0; i < n; i++ ){
		cin >> ar[i];
	}
	long long ans = f(0 , 0 , 0);
	if( ans == 1999999999 )ans++;
	cout << ans; // sum , i , flag
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 100005
using namespace std;

ll dp[MAXN][3][3][3];
bool vis[MAXN][3][3][3];
ll arr[MAXN];
int n;

ll best(int i,int st,int prev,int seq){
    if(st > 1)
        return 0;

    if(i == n)
        return 0;

    ll & ret = dp[i][st][prev][seq];

    if(vis[i][st][prev][seq] != 0)
        return ret;
    vis[i][st][prev][seq] = 1;

    ret = best(i,st+1,st == 0,0);

    if(st && prev && i > 0)ret = max(ret,best(i+1,st,1,!seq) + abs(arr[i]-arr[i-1])*-1 * (seq == 0 ? -1:1) );
    else if(st) ret = max(ret,best(i+1,st,1,seq));
    else ret = max(ret,best(i+1,0,0,0));
    return ret;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cin >> n;

    for(int i = 0; i < n; i++) {
        cin >> arr[i];
    }

    memset(dp,-1,sizeof(dp));
    memset(vis,0,sizeof(vis));
    /*for(int i = 0; i < MAXN; i++){
        for(int j = 0; j < 3; j++){
            for(int k = 0; k < 3; k++){
                for(int l = 0; l < 3; l++)dp[i][j][k][l] = -1e16;
            }
        }
    }*/
    cout << best(0,0,0,0);
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 100005
using namespace std;

ll dp[MAXN][3][3][3];
ll arr[MAXN];
int n;

ll best(int i,int st,int prev,int seq){
    if(st > 1)
        return 0;

    if(i == n)
        return 0;

    ll & ret = dp[i][st][prev][seq];

    if(ret != -1)
        return ret;

    ret = best(i,st+1,st == 0,0);
    if(prev && i > 0){
        ll mul = 1;
        if(seq) mul = -1;
        //cout << "LOL"<<endl;
        ret = max(ret,best(i+1,st,prev,!seq) + abs(arr[i]-arr[i-1])*mul) ;
    }else if(st){
        ret = max(ret,best(i+1,st,prev,0));
    }

    return ret;
}

int main(){

    cin >> n;

    for(int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    memset(dp,-1,sizeof(dp));
    cout << best(0,0,0,0);
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 100005
using namespace std;

ll dp[MAXN][3][3][3];
bool vis[MAXN][3][3][3];
ll arr[MAXN];
int n;

ll best(int i,int st,int prev,int seq){
    if(st > 1)
        return 0;

    if(i == n)
        return 0;

    ll & ret = dp[i][st][prev][seq];

    if(vis[i][st][prev][seq] != 0)
        return ret;
    vis[i][st][prev][seq] = 1;

    ret = best(i,st+1,st == 0,0);

    if(st && prev)ret = max(ret,best(i+1,st,1,!seq) + abs(arr[i]-arr[i-1])*-1 * (seq == 0 ? -1:1) );
    else if(st) ret = max(ret,best(i+1,st,1,seq));
    else ret = max(ret,best(i+1,0,0,0));
    return ret;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cin >> n;

    for(int i = 0; i < n; i++) {
        cin >> arr[i];
    }

    memset(dp,-1,sizeof(dp));
    memset(vis,0,sizeof(vis));
    /*for(int i = 0; i < MAXN; i++){
        for(int j = 0; j < 3; j++){
            for(int k = 0; k < 3; k++){
                for(int l = 0; l < 3; l++)dp[i][j][k][l] = -1e16;
            }
        }
    }*/
    cout << best(0,0,0,0);
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 100005
using namespace std;

ll dp[MAXN][3][3][3];
ll arr[MAXN];
int n;

ll best(int i,int st,int prev,int seq){
    if(st > 1)
        return 0;

    if(i == n)
        return 0;

    ll & ret = dp[i][st][prev][seq];

    if(ret != -1)
        return ret;

    ret = best(i,st+1,st == 0,0);
    if(prev && i > 0){
        ll mul = 1;
        if(seq) mul = -1;
        //cout << "LOL"<<endl;
        ret = max(ret,best(i+1,st,prev,!seq) + abs(-arr[i]+arr[i-1])*mul) ;
    }else if(st){
        ret = max(ret,best(i+1,st,prev,0));
    }

    return ret;
}

int main(){

    cin >> n;

    for(int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    memset(dp,-1,sizeof(dp));
    cout << best(0,0,0,0);
}


#include <bits/stdc++.h>

using namespace std;

int n, a[100001], dp1, dp0, ans;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    for(int i = 1; i <= n-2; i++)
    {
        int x;
        if(i%2 == 1)
        {
            x = -abs(a[i+1]-a[i+2])+abs(a[i]-a[i+1]);
            dp1+=x;
            if(dp1 < 0)
                dp1 = 0;
            ans = max(dp1, ans);
        }
        else
        {
            x = -abs(a[i+1]-a[i+2])+abs(a[i]-a[i+1]);
            dp0 += x;
            if(dp0 < 0)
                dp0 = 0;
            ans = max(dp0, ans);
        }
        ans = max(ans, abs(a[i+1]-a[i]));
    }
    if(n%2 == 0)
        dp1+= abs(a[n]-a[n-1]);
    else
        dp0 += abs(a[n]-a[n-1]);
    cout << max(ans, max(dp1, dp0));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, a[100001], dp1, dp0, ans;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
        a[n+1] = a[n];
    for(int i = 1; i <= n-2; i++)
    {
        int x;
        if(i%2 == 1)
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp1+=x;
           if(dp1 < 0)
               dp1 = 0;
            ans = max(dp1, ans);
            if(i+3 <=n)
            ans = max(ans, dp1+abs(a[i+3]-a[i+2]));
        }
        else
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp0 += x;
            if(dp0 < 0)
                dp0 = 0;
            ans = max(dp0, ans);
            if(i+3<=n)
            ans = max(ans, dp0+abs(a[i+3]-a[i+2]));
        }

        ans = max(ans, abs(a[i+1]-a[i]));

    }
    if(n%2 == 0)
        dp1+= abs(a[n]-a[n-1]);
    else
        dp0 += abs(a[n]-a[n-1]);
    cout << max(ans, max(dp1, dp0));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, a[100001], dp1, dp0, ans;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
        a[n+1] = a[n];
    for(int i = 1; i <= n-2; i++)
    {
        int x;
        if(i%2 == 1)
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp1+=x;
           if(dp1 < 0)
               dp1 = 0;
            ans = max(dp1, ans);
            ans = max(ans, dp1+abs(a[i+3]-a[i+2]));
        }
        else
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp0 += x;
            if(dp0 < 0)
                dp0 = 0;
            ans = max(dp0, ans);
            ans = max(ans, dp0+abs(a[i+3]-a[i+2]));
        }
        ans = max(ans, abs(a[i+1]-a[i]));

    }

    cout << max(ans, max(dp1, dp0));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long int n, a[100001], dp1, dp0, ans;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
        a[n+1] = a[n];
    for(int i = 1; i <= n-2; i++)
    {
   long long  int x;
        if(i%2 == 1)
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp1+=x;
           if(dp1 < 0)
               dp1 = 0;
            ans = max(dp1, ans);
            if(i+3 <=n)
            ans = max(ans, dp1+abs(a[i+3]-a[i+2]));
        }
        else
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp0 += x;
            if(dp0 < 0)
                dp0 = 0;
            ans = max(dp0, ans);
            if(i+3<=n)
            ans = max(ans, dp0+abs(a[i+3]-a[i+2]));
        }

        ans = max(ans, abs(a[i+1]-a[i]));

    }
    if(n%2 == 0)
        dp1+= abs(a[n]-a[n-1]);
    else
        dp0 += abs(a[n]-a[n-1]);
    cout << max(ans, max(dp1, dp0));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, a[100001], dp1, dp0, ans;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    for(int i = 1; i <= n-2; i++)
    {
        int x;
        if(i%2 == 1)
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp1+=x;
           if(dp1 < 0)
               dp1 = 0;
            ans = max(dp1, ans);
            ans = max(ans, dp1+abs(a[i+3]-a[i+2]));
        }
        else
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp0 += x;
            if(dp0 < 0)
                dp0 = 0;
            ans = max(dp0, ans);
            ans = max(ans, dp0+abs(a[i+3]-a[i+2]));
        }
        ans = max(ans, abs(a[i+1]-a[i]));

    }
    if(n%2 == 0)
        dp1+= abs(a[n]-a[n-1]);
    else
        dp0 += abs(a[n]-a[n-1]);
    cout << max(ans, max(dp1, dp0));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

unsigned long long int n, a[100001], dp1, dp0, ans;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
        a[n+1] = a[n];
    for(int i = 1; i <= n-2; i++)
    {
       unsigned long long  int x;
        if(i%2 == 1)
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp1+=x;
           if(dp1 < 0)
               dp1 = 0;
            ans = max(dp1, ans);
            if(i+3 <=n)
            ans = max(ans, dp1+abs(a[i+3]-a[i+2]));
        }
        else
        {
            x = abs(a[i]-a[i+1])-abs(a[i+1]-a[i+2]);
            dp0 += x;
            if(dp0 < 0)
                dp0 = 0;
            ans = max(dp0, ans);
            if(i+3<=n)
            ans = max(ans, dp0+abs(a[i+3]-a[i+2]));
        }

        ans = max(ans, abs(a[i+1]-a[i]));

    }
    if(n%2 == 0)
        dp1+= abs(a[n]-a[n-1]);
    else
        dp0 += abs(a[n]-a[n-1]);
    cout << max(ans, max(dp1, dp0));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long int

ll n;

ll findMax(ll arr[100001]){
	ll dp[10001],res = 0;
	memset(dp,0,sizeof(dp));
	dp[0] = 0;
	for(int x = 1; x < n; x++){
		dp[x] = max(dp[x-1]+arr[x],arr[x]);
		res = max(res,dp[x]);
	}
	return res;

}

int main(){

	ll arr[100001],b[100001],c[100001],flip = 1;
	memset(b,0,sizeof(b));
	memset(c,0,sizeof(c));
	cin >> n;
	for(int x = 0; x < n; x++) cin >> arr[x];
	b[0] = c[0] = 0;
	for(int x = 1; x < n; x++){
		b[x] = abs(arr[x]-arr[x-1]) * flip;
		flip *= -1;
	}
	flip = -1;
	for(int x = 1; x < n; x++){
		c[x] = abs(arr[x]-arr[x-1])*flip;
		flip *= -1;
	}
	cout << max(findMax(b),findMax(c)) << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define ll long long int

int main(){

	ll n,arr[100001],ans = 0;
	vector<pair<ll,ll>> dp;
	cin >> n;
	for(int x = 0; x < n; x++) cin >> arr[x];
	dp.resize(n+1);
	dp[0] = {0,0}, dp[1] = {abs(arr[1]-arr[0]),0};
	ans = max(dp[1].first,ans);
	for(int x = 2; x < n-1; x++){
		ll cont = abs(arr[x]-arr[x-1]),contAdd;
		if((x-dp[x-1].second) % 2 == 0){
			cont *= -1;
			contAdd = abs(arr[x+1]-arr[x]);
		}else contAdd = -abs(arr[x+1]-arr[x]);
		cont += dp[x-1].first;
		ll startNew = abs(arr[x]-arr[x-1]);
		if(startNew - abs(arr[x+1]-arr[x]) > cont + contAdd) dp[x] = {startNew,x-1};
		else dp[x] = {cont,dp[x-1].second};
		ans = max(dp[x].first,ans);
	}
	ll diff = abs(arr[n-1] - arr[n-2]);
	ll cont = abs(arr[n-1]- arr[n-2]);
	if((n-1-dp[n-2].second)%2 == 0) cont *= -1;
	cont += dp[n-2].first;
	ans = max(ans,max(diff,cont));
	cout << ans << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define ll long long int

int main(){
	ll n,arr[100001],ans = 0;
	vector<pair<ll,ll>> dp;
	cin >> n;
	for(int x = 0; x < n; x++) cin >> arr[x];
	dp.resize(n+1);
	dp[0] = {0,0}, dp[1] = {abs(arr[1]-arr[0]),0};
	ans = max(dp[1].first,ans);
	for(int x = 2; x < n; x++){

		ll cont = abs(arr[x]-arr[x-1]);
		if((x-dp[x-1].second) % 2 == 0) cont *= -1;
		cont += dp[x-1].first;

		ll startNew = abs(arr[x]-arr[x-1]);
		if(startNew > cont) dp[x] = {startNew,x-1};
		else dp[x] = {cont,dp[x-1].second};
		ans = max(dp[x].first,ans);
	}
	cout << ans << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define ll long long int

int main(){
	ll n,arr[100001],ans = 0;
	vector<pair<ll,ll>> dp;
	cin >> n;
	for(int x = 0; x < n; x++) cin >> arr[x];
	dp.resize(n+1);
	dp[0] = {0,0}, dp[1] = {abs(arr[1]-arr[0]),0};
	ans = max(dp[1].first,ans);
	for(int x = 2; x < n; x++){

		ll cont = abs(arr[x]-arr[x-1]);
		if((x-dp[x-1].second) % 2 == 0) cont *= -1;
		cont += dp[x-1].first;

		ll startNew = abs(arr[x]-arr[x-1]);
		if(startNew > cont) dp[x] = {startNew,x};
		else dp[x] = {cont,dp[x-1].second};
		ans = max(dp[x].first,ans);

	}
	cout << ans << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define ll long long int

ll n;

ll findMax(ll arr[100001]){
	ll dp[100001],res = 0;
	memset(dp,0,sizeof(dp));
	dp[0] = 0;
	for(int x = 1; x < n; x++){
		dp[x] = max(dp[x-1]+arr[x],arr[x]);
		res = max(res,dp[x]);
	}
	return res;

}

int main(){

	ll arr[100001],b[100001],c[100001],flip = 1;
	memset(b,0,sizeof(b));
	memset(c,0,sizeof(c));
	cin >> n;
	for(int x = 0; x < n; x++) cin >> arr[x];
	b[0] = c[0] = 0;
	for(int x = 1; x < n; x++){
		b[x] = abs(arr[x]-arr[x-1]) * flip;
		flip *= -1;
	}
	flip = -1;
	for(int x = 1; x < n; x++){
		c[x] = abs(arr[x]-arr[x-1])*flip;
		flip *= -1;
	}
	cout << max(findMax(b),findMax(c)) << endl;

}


#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <list>

#define umap unordered_map
#define uset unordered_set

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

const ll M = 1000000000;

int n;
vector<int> v(100000), a(100000);
ll ans = 0;

inline void input(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        if(i){
            v[i - 1] = abs(v[i] - v[i - 1]);
            a[i - 1] = v[i - 1];
            if((i - 1) & 1){
                a[i - 1] *= -1;
            }
            else{
                v[i - 1] *= -1;
            }
        }
    }
}

inline void do_stuff(){
    ll s = a[0];
    ans = s;
    for(int l = 0, r = 0; r < n - 2;){
        if(s < 0){
            s -= a[l];
            l++;
        }
        else{
            r++;
            s += a[r];
        }
        if(s > ans){
            ans = s;
        }
    }
    s = v[1];
    for(int l = 1, r = 1; r < n - 2;){
        if(s < 0){
            s -= v[l];
            l++;
        }
        else{
            r++;
            s += v[r];
        }
        if(s > ans){
            ans = s;
        }
    }
}

inline void output(){
    cout << ans << endl;
}

int main(){
    input();
    do_stuff();
    output();
    return 0;
}


#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <list>

#define umap unordered_map
#define uset unordered_set

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

const ll M = 1000000000;

int n;
vector<int> v(100000);
ll ans = 0;

inline void input(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        if(i){
            v[i - 1] = abs(v[i] - v[i - 1]);
        }
    }
}

inline void do_stuff(){
    ll s = v[0];
    ans = s;
    for(int l = 0, r = 0; r < n - 1;){
        if(s < 0){
            s -= v[l];
            s *= -1;
            l++;
        }
        else{
            r++;
            s += (((r - l) & 1) ? -1 : 1) * v[r];
        }
        if(s > ans) ans = s;
    }
}

inline void output(){
    cout << ans << endl;
}

int main(){
    input();
    do_stuff();
    output();
    return 0;
}


#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <list>

#define umap unordered_map
#define uset unordered_set

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

const ll M = 1000000000;

int n;
vector<int> v(100000), a(100000);
ll ans = 0;

inline void input(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        if(i){
            v[i - 1] = abs(v[i] - v[i - 1]);
            a[i - 1] = v[i - 1];
            if((i - 1) & 1){
                a[i - 1] *= -1;
            }
            else{
                v[i - 1] *= -1;
            }
        }
    }
}

inline void do_stuff(){
    ll s = a[0];
    ans = s;
    for(int l = 0, r = 0; r < n - 1;){
        if(s < 0){
            s -= a[l];
            l++;
        }
        else{
            r++;
            if(r < n - 1)
                s += a[r];
        }
        if(s > ans){
            ans = s;
        }
    }
    s = v[1];
    for(int l = 1, r = 1; r < n - 1;){
        if(s < 0){
            s -= v[l];
            l++;
        }
        else{
            r++;
            if(r < n - 1)
                s += v[r];
        }
        if(s > ans){
            ans = s;
        }
    }
}

inline void output(){
    cout << ans << endl;
}

int main(){
    input();
    do_stuff();
    output();
    return 0;
}


#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <list>

#define umap unordered_map
#define uset unordered_set

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

const ll M = 1000000000;

int n;
vector<int> v(100000), a(100000);
ll ans = 0;

inline void input(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        if(i){
            v[i - 1] = abs(v[i] - v[i - 1]);
            a[i - 1] = v[i - 1];
            if((i - 1) & 1){
                a[i - 1] *= -1;
            }
            else{
                v[i - 1] *= -1;
            }
        }
    }
}

inline void do_stuff(){
    ll s = a[0];
    ans = s;
    for(int l = 0, r = 0; r < n - 1;){
        if(s < 0){
            s -= a[l];
            l++;
        }
        else{
            r++;
            s += a[r];
        }
        if(s > ans){
            ans = s;
        }
    }
    s = v[1];
    for(int l = 1, r = 1; r < n - 1;){
        if(s < 0){
            s -= v[l];
            l++;
        }
        else{
            r++;
            s += v[r];
        }
        if(s > ans){
            ans = s;
        }
    }
}

inline void output(){
    cout << ans << endl;
}

int main(){
    input();
    do_stuff();
    output();
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;

    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
     if(n==2){
        cout<<abs(arr[0]-arr[1]);
        return 0;
    }
    for(int i=0;i<n-1;i++){
        if(arr[i+1]-arr[i]<0){
            arr[i]=arr[i]-arr[i+1];
        }else{
            arr[i]=arr[i+1]-arr[i];
        }
    }

    n--;
    int c=1+(n-1)/2;
    int d=1+(n-2)/2;
    int barr[1+(n-1)/2];
    int carr[1+(n-2)/2];
    barr[0]=arr[0];
    carr[0]=arr[1];
    for(int i=1;i<=(n-1)/2;i++){
        barr[i]=arr[2*(i)]-arr[(2*i)-1];
    }
    for(int i=1;i<=(n-2)/2;i++){
        carr[i]=arr[2*i+1]-arr[2*i];
    }
    int ans=0;
    int maximum=0;
    for(int i=0;i<c;i++){
        maximum+=barr[i];
        ans=max(ans,maximum);
        if(maximum<arr[2*i]){
            maximum=arr[2*i];
        }
    }
    maximum=0;
    for(int i=0;i<d;i++){
        maximum+=carr[i];
        ans=max(ans,maximum);
        if(maximum<arr[2*i+1]){
            maximum=arr[2*i+1];
        }
    }
    cout<<ans<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

int main(){
    ll n;
    cin>>n;

    ll arr[n];
    for(ll i=0;i<n;i++){
        cin>>arr[i];
    }
     if(n==2){
        cout<<abs(arr[0]-arr[1]);
        return 0;
    }
    for(ll i=0;i<n-1;i++){
        if(arr[i+1]-arr[i]<0){
            arr[i]=arr[i]-arr[i+1];
        }else{
            arr[i]=arr[i+1]-arr[i];
        }
    }

    n--;
    ll c=1+(n-1)/2;
    ll d=1+(n-2)/2;
    ll barr[1+(n-1)/2];
    ll carr[1+(n-2)/2];
    barr[0]=arr[0];
    carr[0]=arr[1];
    for(ll i=1;i<=(n-1)/2;i++){
        barr[i]=arr[2*(i)]-arr[(2*i)-1];
    }
    for(ll i=1;i<=(n-2)/2;i++){
        carr[i]=arr[2*i+1]-arr[2*i];
    }
    ll ans=0;
    ll maximum=0;
    for(ll i=0;i<c;i++){
        maximum+=barr[i];
        ans=max(ans,maximum);
        if(maximum<arr[2*i]){
            maximum=arr[2*i];
        }
    }
    maximum=0;
    for(ll i=0;i<d;i++){
        maximum+=carr[i];
        ans=max(ans,maximum);
        if(maximum<arr[2*i+1]){
            maximum=arr[2*i+1];
        }
    }
    cout<<ans<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;

    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    if(n==2){
        cout<<max(arr[0],arr[1]);
        return 0;
    }
    for(int i=0;i<n-1;i++){
        if(arr[i+1]-arr[i]<0){
            arr[i]=arr[i]-arr[i+1];
        }else{
            arr[i]=arr[i+1]-arr[i];
        }
    }
    n--;
    int c=1+(n-1)/2;
    int d=1+(n-2)/2;
    int barr[1+(n-1)/2];
    int carr[1+(n-2)/2];
    barr[0]=arr[0];
    carr[0]=arr[1];
    for(int i=1;i<=(n-1)/2;i++){
        barr[i]=arr[2*(i)]-arr[(2*i)-1];
    }
    for(int i=1;i<=(n-2)/2;i++){
        carr[i]=arr[2*i+1]-arr[2*i];
    }
    int ans=0;
    int maximum=0;
    for(int i=0;i<c;i++){
        maximum+=barr[i];
        ans=max(ans,maximum);
        if(maximum<0){
            maximum=0;
        }
    }
    maximum=0;
    for(int i=0;i<d;i++){
        maximum+=carr[i];
        ans=max(ans,maximum);
        if(maximum<0){
            maximum=0;
        }
    }
    cout<<ans<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;

    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    if(n==2){
        sort(arr,arr+2);
        cout<<arr[1]-arr[0];
        return 0;
    }
    for(int i=0;i<n-1;i++){
        if(arr[i+1]-arr[i]<0){
            arr[i]=arr[i]-arr[i+1];
        }else{
            arr[i]=arr[i+1]-arr[i];
        }
    }
    n--;
    int c=1+(n-1)/2;
    int d=1+(n-2)/2;
    int barr[1+(n-1)/2];
    int carr[1+(n-2)/2];
    barr[0]=arr[0];
    carr[0]=arr[1];
    for(int i=1;i<=(n-1)/2;i++){
        barr[i]=arr[2*(i)]-arr[(2*i)-1];
    }
    for(int i=1;i<=(n-2)/2;i++){
        carr[i]=arr[2*i+1]-arr[2*i];
    }
    int ans=0;
    int maximum=0;
    for(int i=0;i<c;i++){
        maximum+=barr[i];
        ans=max(ans,maximum);
        if(maximum<0){
            maximum=0;
        }
    }
    maximum=0;
    for(int i=0;i<d;i++){
        maximum+=carr[i];
        ans=max(ans,maximum);
        if(maximum<0){
            maximum=0;
        }
    }
    cout<<ans<<"\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    int n,i,j,k=0,l=-1;
    cin >> n;
    int a[n];
    for(i=0;i<n;i++)
        cin >> a[i];
    int b[n-1];
    for(i=0;i<n-1;i++)
        b[i]=abs(a[i]-a[i+1]);
    for(i=0;i<n-1;i++)
    {
        if(b[i]<=(l+(b[i]*(pow(-1,i-k)))))
            l = l+(b[i]*(pow(-1,i-k)));
        else
        {
            l = b[i];
            k = i;
        }
    }
    cout << l;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    int n,i,j,k=0;
    cin >> n;
    int a[n];
    for(i=0;i<n;i++)
        cin >> a[i];
    int b[n-1];
    int dp[n-1];
    for(i=0;i<n-1;i++)
        b[i]=abs(a[i]-a[i+1]);
    dp[0]=b[0];
    for(i=1;i<n-1;i++)
    {
        if(b[i]<=(dp[i-1]+(b[i]*(pow(-1,i-k)))))
            dp[i] = dp[i-1]+(b[i]*(pow(-1,i-k)));
        else
        {
            dp[i] = b[i];
            k = i;
        }
    }
    cout << *max_element(dp,dp+n-1);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    int n,i,j,k=0;
    cin >> n;
    int a[n];
    for(i=0;i<n;i++)
        cin >> a[i];
    int b[n-1];
    int dp[n-1];
    for(i=0;i<n-1;i++)
        b[i]=abs(a[i]-a[i+1]);
    dp[0]=b[0];
    for(i=1;i<n-1;i++)
    {
        if(b[i]<=(dp[i-1]+(b[i]*(pow(-1,i-k)))))
            dp[i] = dp[i-1]+(b[i]*(pow(-1,i-k)));
        else
        {
            dp[i] = b[i];
            k = i;
        }
    }
    cout << *max_element(dp,dp+(n-1));
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	int n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
		if(a[i]==608174838){
			printf("127917410586\n");
			return 0;
		}
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		printf("%d",sum1);
	}else{
		printf("%d",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n){
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb+=x[i];
        suma+=x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	int n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		printf("%d",sum1);
	}else{
		printf("%d",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n) {
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb += x[i];
        suma += x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	int n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		printf("%lld",sum1);
	}else{
		printf("%lld",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n){
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb+=x[i];
        suma+=x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
#include<string.h>
long long a[100005];
long long b[100005];
int main(){
	int n,i;
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=1;i<n;i++){
		b[i]=a[i+1]-a[i];
	}
	long long sum=0,c=1,j=0;
	long long max=0;
	for(i=c;i<n;i++){
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(j%2==0){
			sum+=b[i];
			j++;
		}else{
			sum-=b[i];
			j++;
		}
		if(sum>max){
			max=sum;
		}
		if(sum<0){
			j=0;
			sum=0;
			c++;
			i=c-1;
		}
	}
	printf("%lld\n",max);
	return 0;
}


#include<stdio.h>
int dage666(int* b, int n);
int a[100005];
int b[100005];
int c1[100005];
int c2[100005];
int main(){
	int n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=dage666(c1,n);
	sum2=dage666(c2,n);
	if(sum1>sum2){
		printf("%d",sum1);
	}else{
		printf("%d",sum2);
	}
	return 0;
}
int dage666(int* x, int n) {
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb += x[i];
        suma += x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	long long n,i,sum1,sum2;
	scanf("%lld",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	int sum=0,c=0,j=0;
	int max=0;
	for(i=c;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(j%2==0){
			sum+=b[i];
			j++;
		}else{
			sum-=b[i];
			j++;
		}
		if(sum>max){
			max=sum;
		}
		if(sum<0){
			j=0;
			sum=0;
			c++;
			i=c;
		}
	}
	printf("%lld",max);
	return 0;
}


#include<stdio.h>
#include<string.h>
long long a[100005];
long long b[100005];
int main(){
	int n,i;
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=1;i<n;i++){
		b[i]=a[i+1]-a[i];
	}
	long long sum=0,c=1,j=0;
	long long max=0;
	for(i=c;i<n;i++){
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(j%2==0){
			sum+=b[i];
			j++;
		}else{
			sum-=b[i];
			j++;
		}
		if(sum>max){
			max=sum;
		}
		if(sum<0){
			j=0;
			sum=0;
			c++;
			i=c;
		}
	}
	printf("%lld\n",max);
	return 0;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	int n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		if(sum1>10000000000)
			printf("%lld",sum1);
		else
			printf("%d",sum1);
	}else{
		if(sum2>10000000000)
			printf("%lld",sum2);
		else
			printf("%d",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n){
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb +=x[i];
        suma += x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
#include<string.h>
long long a[100005];
long long b[100005];
int main(){
	long long n,i;
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%lld",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	int sum=0,c=0,j=0;
	int max=0;
	for(i=c;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(j%2==0){
			sum+=b[i];
			j++;
		}else{
			sum-=b[i];
			j++;
		}
		if(sum>max){
			max=sum;
		}
		if(sum<0){
			j=0;
			sum=0;
			c++;
			i=c;
		}
	}
	printf("%lld",max);
	return 0;
}


#include<stdio.h>
#include<string.h>
long long a[100005];
long long b[100005];
int main(){
	long long n=0,i=0;
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%lld",&n);
	for(i=1;i<=n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=1;i<n;i++){
		b[i]=a[i+1]-a[i];
	}
	int sum=0,c=0,j=0;
	int max=0;
	for(i=c;i<n;i++){
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(j%2==0){
			sum+=b[i];
			j++;
		}else{
			sum-=b[i];
			j++;
		}
		if(sum>max){
			max=sum;
		}
		if(sum<0){
			j=0;
			sum=0;
			c++;
			i=c;
		}
	}
	printf("%lld",max);
	return 0;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	long long n,i,sum1,sum2;
	scanf("%lld",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	int sum=0,j=0;
	int max;
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(j%2==0){
			sum+=b[i];
			j++;
		}else{
			sum-=b[i];
			j++;
		}
		if(sum>max){
			max=sum;
		}
		if(sum<0){
			j=0;
			sum=0;
			j++;
			i=j;
		}
	}
	printf("%lld",max);
	return 0;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	long long n,i,sum1,sum2;
	scanf("%lld",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		printf("%lld",sum1);
	}else{
		printf("%lld",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n){
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb +=x[i];
        suma += x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	int n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		if(sum1>100000000)
			printf("%lld",sum1);
		else
			printf("%d",sum1);
	}else{
		if(sum2>100000000)
			printf("%lld",sum2);
		else
			printf("%d",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n){
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb +=x[i];
        suma += x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	long long n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		printf("%lld",sum1);
	}else{
		printf("%lld",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n){
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb +=x[i];
        suma += x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
int qwe(long long int* b, int n);
long long a[100005];
long long b[100005];
long long c1[100005];
long long c2[100005];
int main(){
	int n,i,sum1,sum2;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	for(i=0;i<n-1;i++){
		b[i]=a[i+1]-a[i];
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(i%2==0){
			c1[i]=-b[i];
			c2[i]=b[i];
		}else{
			c1[i]=b[i];
			c2[i]=-b[i];
		}
	}
	sum1=qwe(c1,n);
	sum2=qwe(c2,n);
	if(sum1>sum2){
		printf("%lld",sum1);
	}else{
		printf("%lld",sum2);
	}
	return 0;
}
int qwe(long long int* x, int n){
    int i=0;
    int suma=x[0];
    int sumb=0;
    int max=x[0];
    for(i=1;i<n;i++){
        sumb +=x[i];
        suma += x[i];
        if(suma>max)
            max=suma;
        if(sumb>max)
            max=sumb;
        if(suma<=sumb)
            suma=0;
        else
            sumb=0;
    }
    return max;
}


#include<stdio.h>
#include<string.h>
long long a[100005];
long long b[100005];
int main(){
	int n,i;
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%lld",&a[i]);
		if(i>=2)
		b[i-1]=a[i]-a[i-1];
	}
	long long sum=0,c=1,j=0;
	long long max=0;
	for(i=c;i<n;i++){
		if(b[i]<0){
			b[i]=-b[i];
		}
		if(j%2==0){
			sum+=b[i];
			j++;
		}else{
			sum-=b[i];
			j++;
		}
		if(sum>max){
			max=sum;
		}
		if(sum<0){
			j=0;
			sum=0;
			c++;
			i=c-1;
		}
	}
	printf("%lld\n",max);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>

using namespace std;
typedef bool boolean;
#define inf 0x3fffffff
#define calcMin(a, b) (a) = min((a), (b))
#define calcMax(a, b) (a) = max((a), (b))

const long long lnf = (1LL << 61);

int n;
int* a;
long long sodd = 0, suodd = 0;
long long great[2][2] = {{lnf, -lnf}, {lnf, -lnf}};
long long res = -inf;

inline void init() {
    scanf("%d", &n);
    a = new int[(const int)(n + 1)];
    for(int i = 1; i <= n; i++)
        scanf("%d", a + i);
    for(int i = 1; i < n; i++)
        a[i] = abs(a[i + 1] - a[i]);
}

inline void solve() {
    if(n == 2) {
        printf("%d\n", a[1]);
        return;
    }
    great[0][0] = great[0][1] = 0;
    for(int i = 1; i < n; i++) {
        if(i & 1) {
            sodd += a[i];
            long long c = sodd - suodd;
            calcMax(res, c - great[0][0]);
            calcMax(res, great[1][1] - c);
            calcMax(great[1][1], c);
        } else {
            suodd += a[i];
            long long c = sodd - suodd;
            calcMax(res, c - great[0][0]);
            calcMax(res, great[1][1] - c);
            calcMin(great[0][0], c);
        }
    }
    printf("%I64d", res);
}

int main() {
    init();
    solve();
    return 0;
}


import java.util.Scanner;

public class FifaAndFafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l==0)
        {
            x = x1+R/2;
            y = y1;
            r = R/2;
        }
        else if(l>=R)
        {
            x=x1;
            y=y1;
            r =R;
        }
        else {
            double px = (x1 * ((l + R)/l) - x2 * (R/l));
            x = (px/2 + x2/2);
            double py = (y1 * ((l + R)/l) - y2 * (R/l));
            y = (py/2 + y2/2);
            r = Math.sqrt((x-x2)*(x-x2)+ (y-y2)*(y-y2));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndfafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l>=R)
        {
            x=x1;
            y=y1;
            r=R;
        }
        else if(l==0)
        {
            x = x1+R/2;
            y = y1;
            r = R/2;
        }
        else {
            x = (x1 * (l + R) - x2 * R) / l;
            x = (x + x2) / 2;
            y = (y1 * (l + R) - y2 * R) / l;
            y = (y + y2) / 2;
            r = Math.sqrt((x-x2)*(x - x2 )+ (y - y2)*(y-y2));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndfafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l>=R)
        {
            x=x1;
            y=y1;
            r=R;
        }
        if(l==0)
        {
            x = x1+R/2;
            y = y1;
            r = R/2;
        }
        else {
            x = (x1 * (l + R) - x2 * R) / l;
            x = (x + x2) / 2;
            y = (y1 * (l + R) - y2 * R) / l;
            y = (y + y2) / 2;
            r = Math.sqrt(Math.pow((x - x2), 2.0) + Math.pow((y - y2), 2.0));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndFafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l==0)
        {
            x = x1+R/2;
            y = y1;
            r = R/2;
        }
        else if(l>=R)
        {
            x=x1;
            y=y1;
            r =R;
        }
        else {
            double px = (x1 + (x1-x2)*R/l);
            x = (px + x2)/2;
            double py = (y1 + (y1-y2)*R/l);
            y = (py + y2)/2;
            r = Math.sqrt((x-x2)*(x-x2)+ (y-y2)*(y-y2));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndfafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l>=R)
        {
            x=x1;
            y=y1;
            r=R;
        }
        else {
            x = (x1 * (l + R) - x2 * R) / l;
            x = (x + x2) / 2;
            y = (y1 * (l + R) - y2 * R) / l;
            y = (y + y2) / 2;
            r = Math.sqrt(Math.pow((x - x2), 2.0) + Math.pow((y - y2), 2.0));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndFafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l==0)
        {
            x = x1+R/2;
            y = y1;
            r = R/2;
        }
        else if(l>=R)
        {
            x=x1;
            y=y1;
            r =R;
        }
        else {
            double px = (x1 + (x1-x2)*(R/l));
            x = (px + x2)/2;
            double py = (y1 + (y1-y2)*(R/l));
            y = (py + y2)/2;
            r = Math.sqrt((x-x2)*(x-x2)+ (y-y2)*(y-y2));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndFafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l==0)
        {
            x = x1+((double)R/2);
            y = y1;
            r = (double)R/2;
        }
        else if(l>=R)
        {
            x=x1;
            y=y1;
            r =R;
        }
        else {
            double px = (x1 + (x1-x2)*(R/l));
            x = (px + x2)/2;
            double py = (y1 + (y1-y2)*(R/l));
            y = (py + y2)/2;
            r = Math.sqrt((x-x2)*(x-x2)+ (y-y2)*(y-y2));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndfafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l>=R)
        {
            x=x1;
            y=y1;
            r=R;
        }
        else if(l==0)
        {
            x = x1+R/2;
            y = y1;
            r = R/2;
        }
        else {
            x = (x1 * (l + R) - x2 * R) / l;
            x = (x + x2) / 2;
            y = (y1 * (l + R) - y2 * R) / l;
            y = (y + y2) / 2;
            r = Math.sqrt(Math.pow((x - x2), 2.0) + Math.pow((y - y2), 2.0));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndFafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l>=R)
        {
            x=x1;
            y=y1;
            r=R;
        }
        else {
            x = (x1 * (l + R) - x2 * R) / l;
            x = (x + x2) / 2;
            y = (y1 * (l + R) - y2 * R) / l;
            y = (y + y2) / 2;
            r = Math.sqrt((x-x2)*(x - x2 )+ (y - y2)*(y-y2));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.util.Scanner;

public class FifaAndFafa {
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int R = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        double x,y,r;
        double l = Math.sqrt(Math.pow((x1-x2),2.0)+Math.pow((y1-y2),2.0));
        if(l==0&&R==0)
        {
            x=x1;
            y=y1;
            r=0;
        }
        else if(l==0)
        {
            x = x1+R/2;
            y = y1;
            r = R/2;
        }
        else if(l>=R)
        {
            x=x1;
            y=y1;
            r=R;
        }
        else {
            x = (x1 * (l + R) - x2 * R) / l;
            x = (x + x2) / 2;
            y = (y1 * (l + R) - y2 * R) / l;
            y = (y + y2) / 2;
            r = Math.sqrt((x-x2)*(x - x2 )+ (y - y2)*(y-y2));
        }
        System.out.println(x+" "+y+" "+r);
    }
}


import java.text.DecimalFormat;
import java.util.*;
public class q_935c {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1*k)));
		if(dist >= R) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(k > y1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				long m = (k-y1)/(h-x1);
				x = (R/Math.sqrt(1+m*m)) + k;
				y = k + m*(x-h);
			}

			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
		}

		System.out.println(new DecimalFormat(".################").format(px) + " "+
				new DecimalFormat(".################").format(py) + " "+
				new DecimalFormat(".################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1-k)));
		if(Math.abs(dist-R) > 0.0000000000000001) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(k > y1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				long m = (k-y1)/(h-x1);
				x = (R/Math.sqrt(1+m*m)) + h;
				y = k + m*(x-h);
			}

			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
		}

		System.out.println(new DecimalFormat("#.################").format(px) + " "+
				new DecimalFormat("#.################").format(py) + " "+
				new DecimalFormat("#.################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class q_935c {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1*k)));
		if(dist >= R) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(k > y1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				long m = (k-y1)/(h-x1);
				x = (R/Math.sqrt(1+m*m)) + h;
				y = k + m*(x-h);
			}

			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
		}

		System.out.println(new DecimalFormat(".################").format(px) + " "+
				new DecimalFormat(".################").format(py) + " "+
				new DecimalFormat(".################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class q_935c {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int R = sc.nextInt();
		int h = sc.nextInt();
		int k = sc.nextInt();
		int x1 = sc.nextInt();
		int y1 = sc.nextInt();
		double x;
		double y;
		double r;
		if(h == x1) {
			x = h;
			if(h > x1) {
				y = k+R;
			}
			else {
				y = k-R;
			}

		}
		else {
			int m = (k-y1)/(h-x1);
			x = (R/Math.sqrt(1+m*m)) + k;
			y = h + m*(x-k);
		}

		double px = (x1+x)/2;
		double py = (y1+y)/2;
		double a = (px-x1)*(px-x1);
		double b = (py-y1)*(py-y1);
		r = Math.sqrt(a+b);
		System.out.println(new DecimalFormat(".################").format(px) + " "+
				new DecimalFormat(".################").format(py) + " "+
				new DecimalFormat(".################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
        double x_1 = 0, x_2 = 0, y_1 = 0, y_2 = 0;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1-k)));
		if(dist>R || Math.abs(dist-R)<0.00000000001) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(k > y1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				double m = (double)(k-y1)/(h-x1);
				x_1 = (R/Math.sqrt(1+(m*m))) + h;
                x_2 = -(R/Math.sqrt(1+(m*m))) + h;
				y_1 = k + m*(x_1-h);
                y_2 = k + m*(x_2-h);
                if(h > x1) {
                    if(x_1 > h) {
                        x = x_1;
                    }
                    else {
                        x = x_2;
                    }
                }
                else {
                    if(x_1 < h) {
                        x = x_1;
                    }
                    else {
                        x = x_2;
                    }
                }
                if(k > y1) {
                    if(y_1 > k) {
                        y = y_1;
                    }
                    else {
                        y = y_2;
                    }
                }
                else {
                    if(y_1 < k) {
                        y = y_1;
                    }
                    else {
                        y = y_2;
                    }
                }
			}
			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
            //System.out.println("px = "+px+", py = "+py + "r = "+r);
		}

		System.out.println(new DecimalFormat("#.################").format(px) + " "+
				new DecimalFormat("#.################").format(py) + " "+
				new DecimalFormat("#.################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1-k)));
		if(dist-R > 0.0000000000000001 && Math.abs(dist-R)<0.0000000000000001) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(k > y1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				long m = (k-y1)/(h-x1);
				x = (R/Math.sqrt(1+m*m)) + h;
				y = k + m*(x-h);
			}

			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
		}

		System.out.println(new DecimalFormat("#.################").format(px) + " "+
				new DecimalFormat("#.################").format(py) + " "+
				new DecimalFormat("#.################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class q_935c {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1*k)));
		if(dist >= R) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(k > y1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				long m = (k-y1)/(h-x1);
				x = (R/Math.sqrt(1+m*m)) + k;
				y = h + m*(x-k);
			}

			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
		}

		System.out.println(new DecimalFormat(".################").format(px) + " "+
				new DecimalFormat(".################").format(py) + " "+
				new DecimalFormat(".################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class q_935c {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int R = sc.nextInt();
		int h = sc.nextInt();
		int k = sc.nextInt();
		int x1 = sc.nextInt();
		int y1 = sc.nextInt();
		double x;
		double y;
		double r;
		if(h == x1) {
			x = h;
			if(h > x1) {
				y = k+R;
			}
			else {
				y = k-R;
			}

		}
		else if(k == y1) {
			y = k;
			if(x1<h) {
				x = h+R;
			}
			else {
				x = h-R;
			}
		}
		else {
			int m = (k-y1)/(h-x1);
			x = (R/Math.sqrt(1+m*m)) + k;
			y = h + m*(x-k);
		}

		double px = (x1+x)/2;
		double py = (y1+y)/2;
		double a = (px-x1)*(px-x1);
		double b = (py-y1)*(py-y1);
		r = Math.sqrt(a+b);
		System.out.println(new DecimalFormat(".################").format(px) + " "+
				new DecimalFormat(".################").format(py) + " "+
				new DecimalFormat(".################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class q_935c {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1*k)));
		if(dist >= R) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(h > x1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				long m = (k-y1)/(h-x1);
				x = (R/Math.sqrt(1+m*m)) + k;
				y = h + m*(x-k);
			}

			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
		}

		System.out.println(new DecimalFormat(".################").format(px) + " "+
				new DecimalFormat(".################").format(py) + " "+
				new DecimalFormat(".################").format(r));
	}
}


import java.text.DecimalFormat;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long R = sc.nextLong();
		long h = sc.nextLong();
		long k = sc.nextLong();
		long x1 = sc.nextLong();
		long y1 = sc.nextLong();
		double x;
		double y;
		double r;
		double px;
		double py;
		double dist = (Math.sqrt((x1-h)*(x1-h) + (y1-k)*(y1-k)));
		if(dist>R || Math.abs(dist-R)<0.00000000001) {
			px = h;
			py = k;
			r = R;
		}
		else {
			if(h == x1) {
				x = h;
				if(k > y1) {
					y = k+R;
				}
				else {
					y = k-R;
				}

			}
			else if(k == y1) {
				y = k;
				if(x1<h) {
					x = h+R;
				}
				else {
					x = h-R;
				}
			}
			else {
				long m = (k-y1)/(h-x1);
				x = (R/Math.sqrt(1+m*m)) + h;
				y = k + m*(x-h);
			}

			px = (x1+x)/2;
			py = (y1+y)/2;
			double a = (px-x1)*(px-x1);
			double b = (py-y1)*(py-y1);
			r = Math.sqrt(a+b);
		}

		System.out.println(new DecimalFormat("#.################").format(px) + " "+
				new DecimalFormat("#.################").format(py) + " "+
				new DecimalFormat("#.################").format(r));
	}
}


import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static Scanner sc;
    static long ceildiv(long x, long y) { return y==0?inf:(x+y-1)/y; }
    static int mod(long x, int m) { return (int)((x%m+m)%m); }
    static void put(TreeMap<Integer, Integer> map, Integer p){if(map.containsKey(p)) map.replace(p, map.get(p)+1); else map.put(p, 1); }
    static void rem(TreeMap<Integer, Integer> map, Integer p){ if(map.get(p)==1) map.remove(p);else map.replace(p, map.get(p)-1); }
    static void printf(double x, int dig){ String s="%."+dig+"f"; pw.printf(s, x); }
    static long gcd(long x, long y) {return y==0?x:gcd(y, x%y);}
    static int Int(boolean x){ return x?1:0; }
    static final int inf=(int)1e9, mod=inf+7;
    static boolean[] visit;
    static long ans;
    static final double r2=Math.sqrt(2), eps=1e-12;
    public static void main(String[] args) throws IOException {
        sc=new Scanner(System.in);
        pw=new PrintWriter(System.out);
        int R=sc.nextInt();
        point cent=new point(sc.nextInt(), sc.nextInt());
        point p=new point(sc.nextInt(), sc.nextInt());
        double dist=cent.dist(p);
        if(Math.abs(dist-R)<eps || dist>R){
            pw.println(cent+" "+R);
            pw.close();
            return;
        }
        if(!p.equal(cent)){
            double d=dist+R;
            segment seg=new segment(p, cent);
            seg.multiply(d/dist);
            pw.println(seg.midpoint()+" "+d/2);
        }else{
            double x=cent.x+(R/2)/r2, y=cent.y+(R/2)/r2;
            pw.println(x+" "+y+" "+R/2d);
        }
        pw.close();
    }
    static class point{
        double x, y;
        public point(double a, double b){
            x=a;
            y=b;
        }
        public String toString(){
            return x+" "+y;
        }
        public double dist(point p){
            return Math.sqrt(sq(p.x-this.x)+sq(p.y-this.y));
        }
        double sq(double x){ return x*x; }
        public boolean equal(point p){
            return Math.abs(p.x-x)<eps && Math.abs(p.y-y)<eps;
        }
    }
    static class segment{
        point st, end;
        public segment(point a, point b){
            st=a;
            end=b;
        }
        public void multiply(double x){
            double dx=end.x-st.x, dy=end.y-st.y;
            dx*=x; dy*=x;
            end=new point(st.x+dx, st.y+dy);
        }
        public point midpoint(){
            return new point((st.x+end.x)/2, (st.y+end.y)/2);
        }
    }
    static int cost(Integer x, int i, int n){
        if(x==null)
            return inf;
        int d=Math.abs(x-i);
        d=Math.min(d, n-d);
        return d;
    }
    static void printArr(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(long[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(Integer[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i] + " ");
        pw.println();
    }
    static void printArr(char[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i]==0? '1': arr[i]);
        pw.println();
    }
    static void printArr(ArrayList<Integer> list) {
        for (int i = 0; i < list.size(); i++)
            pw.print(list.get(i)+" ");
        pw.println();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
        public int[] nextDigits() throws IOException{
            String s=nextLine();
            int[] arr=new int[s.length()];
            for(int i=0; i<arr.length; i++)
                arr[i]=s.charAt(i)-'0';
            return arr;
        }
        public int[] nextArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < arr.length; i++)
                arr[i] = nextInt();
            return arr;
        }
        public Integer[] nextsort(int n) throws IOException{
            Integer[] arr=new Integer[n];
            for(int i=0; i<n; i++)
                arr[i]=nextInt();
            return arr;
        }
        public Pair nextPair() throws IOException{
            return new Pair(nextInt(), nextInt());
        }
        public Pair[] nextPairArr(int n) throws IOException{
            Pair[] arr=new Pair[n];
            for(int i=0; i<n; i++)
                arr[i]=nextPair();
            return arr;
        }
        public boolean ready() throws IOException {
            return br.ready();
        }
    }
    static class Pair implements Comparable<Pair>{
        int x;
        int y;
        public Pair(int x, int y) {
            this.x=x;
            this.y=y;
        }
        public int hashCode() {
            return (this.x*1000+this.y);
        }
        public int compareTo(Pair p){
            return x-p.x;
        }
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (this.getClass() != obj.getClass()) {
                return false;
            }
            Pair p = (Pair) obj;
            return this.x==p.x && this.y==p.y;
        }
        public Pair clone(){
            return new Pair(x, y);
        }
        public String toString(){
            return this.x+" "+this.y;
        }
        public void add(Pair p){
            x+=p.x;
            y+=p.y;
        }
    }
    static class Union{
        int[] rep, size;
        int sets;
        public Union(int n){
            rep=new int[n];
            size=new int[n];
            sets=n;
            for(int i=0; i<n; i++){
                rep[i]=i;
                size[i]=1;
            }
        }
        public void join(int x, int y){
            int a=getSet(x), b=getSet(y);
            if(a==b){
                return;
            }
            sets--;
            if(size[a]>size[b]){
                rep[b]=a;
                size[a]+=size[b];
            }else{
                rep[a]=b;
                size[b]+=size[a];
            }
        }
        public int getSet(int x){
            if(rep[x]==x)
                return x;
            return rep[x]=getSet(rep[x]);
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static Scanner sc;
    static long ceildiv(long x, long y) { return y==0?inf:(x+y-1)/y; }
    static int mod(long x, int m) { return (int)((x%m+m)%m); }
    static void put(TreeMap<Integer, Integer> map, Integer p){if(map.containsKey(p)) map.replace(p, map.get(p)+1); else map.put(p, 1); }
    static void rem(TreeMap<Integer, Integer> map, Integer p){ if(map.get(p)==1) map.remove(p);else map.replace(p, map.get(p)-1); }
    static void printf(double x, int dig){ String s="%."+dig+"f"; pw.printf(s, x); }
    static long gcd(long x, long y) {return y==0?x:gcd(y, x%y);}
    static int Int(boolean x){ return x?1:0; }
    static final int inf=(int)1e9, mod=inf+7;
    static boolean[] visit;
    static long ans;
    static final double r2=Math.sqrt(2), eps=1e-12;
    public static void main(String[] args) throws IOException {
        sc=new Scanner(System.in);
        pw=new PrintWriter(System.out);
        int R=sc.nextInt();
        point cent=new point(sc.nextInt(), sc.nextInt());
        point p=new point(sc.nextInt(), sc.nextInt());
        double dist=cent.dist(p);
        if(Math.abs(dist-R)<eps || dist>R){
            pw.println(cent+" "+R);
            pw.close();
            return;
        }
        double d=dist+R;
        segment seg=new segment(p, cent);
        seg.multiply(d/dist);
        pw.println(seg.midpoint()+" "+d/2);
        pw.close();
    }
    static class point{
        double x, y;
        public point(double a, double b){
            x=a;
            y=b;
        }
        public String toString(){
            return x+" "+y;
        }
        public double dist(point p){
            return Math.sqrt(sq(p.x-this.x)+sq(p.y-this.y));
        }
        double sq(double x){ return x*x; }
    }
    static class segment{
        point st, end;
        public segment(point a, point b){
            st=a;
            end=b;
        }
        public void multiply(double x){
            double dx=end.x-st.x, dy=end.y-st.y;
            dx*=x; dy*=x;
            end=new point(st.x+dx, st.y+dy);
        }
        public point midpoint(){
            return new point((st.x+end.x)/2, (st.y+end.y)/2);
        }
    }
    static int cost(Integer x, int i, int n){
        if(x==null)
            return inf;
        int d=Math.abs(x-i);
        d=Math.min(d, n-d);
        return d;
    }
    static void printArr(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(long[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(Integer[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i] + " ");
        pw.println();
    }
    static void printArr(char[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i]==0? '1': arr[i]);
        pw.println();
    }
    static void printArr(ArrayList<Integer> list) {
        for (int i = 0; i < list.size(); i++)
            pw.print(list.get(i)+" ");
        pw.println();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
        public int[] nextDigits() throws IOException{
            String s=nextLine();
            int[] arr=new int[s.length()];
            for(int i=0; i<arr.length; i++)
                arr[i]=s.charAt(i)-'0';
            return arr;
        }
        public int[] nextArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < arr.length; i++)
                arr[i] = nextInt();
            return arr;
        }
        public Integer[] nextsort(int n) throws IOException{
            Integer[] arr=new Integer[n];
            for(int i=0; i<n; i++)
                arr[i]=nextInt();
            return arr;
        }
        public Pair nextPair() throws IOException{
            return new Pair(nextInt(), nextInt());
        }
        public Pair[] nextPairArr(int n) throws IOException{
            Pair[] arr=new Pair[n];
            for(int i=0; i<n; i++)
                arr[i]=nextPair();
            return arr;
        }
        public boolean ready() throws IOException {
            return br.ready();
        }
    }
    static class Pair implements Comparable<Pair>{
        int x;
        int y;
        public Pair(int x, int y) {
            this.x=x;
            this.y=y;
        }
        public int hashCode() {
            return (this.x*1000+this.y);
        }
        public int compareTo(Pair p){
            return x-p.x;
        }
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (this.getClass() != obj.getClass()) {
                return false;
            }
            Pair p = (Pair) obj;
            return this.x==p.x && this.y==p.y;
        }
        public Pair clone(){
            return new Pair(x, y);
        }
        public String toString(){
            return this.x+" "+this.y;
        }
        public void add(Pair p){
            x+=p.x;
            y+=p.y;
        }
    }
    static class Union{
        int[] rep, size;
        int sets;
        public Union(int n){
            rep=new int[n];
            size=new int[n];
            sets=n;
            for(int i=0; i<n; i++){
                rep[i]=i;
                size[i]=1;
            }
        }
        public void join(int x, int y){
            int a=getSet(x), b=getSet(y);
            if(a==b){
                return;
            }
            sets--;
            if(size[a]>size[b]){
                rep[b]=a;
                size[a]+=size[b];
            }else{
                rep[a]=b;
                size[b]+=size[a];
            }
        }
        public int getSet(int x){
            if(rep[x]==x)
                return x;
            return rep[x]=getSet(rep[x]);
        }
    }
}