#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e18;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(i) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;    */

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;	*/

	//run on b
	//c[0] = (ll)1e18;

	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		if(i % 2 == 1) mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 0) mn2 = min(mn2, c[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e15;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;    */

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;	*/

	//run on b
	//c[0] = (ll)1e18;

	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		if(i % 2 == 0) mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 1) mn2 = min(mn2, b[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = 0;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;    */

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;	*/

	//run on b
	//c[0] = (ll)1e18;

	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		if(i % 2 == 1) mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 0) mn2 = min(mn2, c[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = 0;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;    */

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;	*/

	//run on b
	//c[0] = (ll)1e18;

	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		if(i % 2 == 0) mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 1) mn2 = min(mn2, c[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e18;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;    */

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;	*/

	//run on b
	//c[0] = (ll)1e18;

	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		if(i % 2 == 0) mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 1) mn2 = min(mn2, c[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e15;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;*/

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";*/

	//run on b
	//c[0] = (ll)1e18;

	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		mn1 = min(mn1, b[i]);
	}

	mn2 = min(mn2, c[0]);
	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		mn2 = min(mn2, b[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e15;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;*/

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";*/

	//run on b
	//c[0] = (ll)1e18;
	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		mn1 = min(mn1, b[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e15;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;*/

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";*/

	//run on b
	//c[0] = (ll)1e18;
	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		if(i % 2 == 1) mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 0) mn1 = min(mn1, b[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e15;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(i & 1) c[i] *= -1;
		else b[i] *= -1;
	}

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";*/

	//run on b
	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, max(b[i] - mn1, c[i] - mn2));
		mn1 = min(mn1, b[i]);
		mn2 = min(mn2, c[i]);
	}

	//run on c

	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e18;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(!(i & 1)) c[i] *= -1;
		else b[i] *= -1;
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;    */

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";
	cout << endl;	*/

	//run on b
	//c[0] = (ll)1e18;

	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		if(i % 2 == 1) mn1 = min(mn1, b[i]);
	}

	for(int i = 1; i < n - 1; i++) {
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 0) mn2 = min(mn2, c[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;
int n;
ll a[100100], b[100100], c[100100];
ll mn1, mn2;
ll ans = -(ll)1e15;

int main() {
	//freopen("", "r", stdin);
	//freopen("", "w", stdout);
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i]) {
			b[i - 1] = abs(a[i] - a[i-1]);
			c[i - 1] = b[i - 1];
		}
	}

	for(int i = 0; i < n - 1; i++) {
		if(i & 1) c[i] *= -1;
		else b[i] *= -1;
	}

	for(int i = 0; i < n - 1; i++) {
		if(i) b[i] += b[i-1];
		if(i) c[i] += c[i-1];
	}

	/*for(int i = 0; i < n - 1; i++) cout << b[i] << " ";
	cout << endl;
	for(int i = 0; i < n - 1; i++) cout << c[i] << " ";*/

	//run on b
	//c[0] = (ll)1e18;
	for(int i = 0; i < n - 1; i++) {
		ans = max(ans, b[i] - mn1);
		ans = max(ans, c[i] - mn2);
		if(i % 2 == 1) mn1 = min(mn1, b[i]);
		if(i % 2 == 0) mn2 = min(mn2, c[i]);
	}

	//run on c
	cout << ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		if(tmp>res)
			res=tmp;
		while(tmp<0&&l<i)
		{
			tmp=-(tmp-abs(num[l]-num[l+1]));
			res=max(tmp,res);
			l++;
		}
	}

	printf("%I64d\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0,r=0;
	for(int i=0;i<n-1;i++)
	{
		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		r=i;
		if(tmp>res)
			res=tmp;
		while(tmp<0&&l<r)
		{
			tmp=-(tmp-abs(num[l]-num[l+1]));
			res=max(tmp,res);
			l++;
		}
	}
	while(l<r)
	{
		tmp=-(tmp-abs(num[l]-num[l+1]));
		res=max(tmp,res);
		l++;
	}
	printf("%I64d\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		if(tmp>res)
			res=tmp;
		if(tmp<0)
		{
			tmp=0;
			l=i;
			i--;
		}
	}
	printf("%I64d\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N],b[N],c[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	for(int i=0;i<n-1;i++)
	{
		if(i%2)
		{
			b[i]=abs(num[i]-num[i+1]);
			c[i]=-abs(num[i]-num[i+1]);
		}
		else
		{
			b[i]=-abs(num[i]-num[i+1]);
			c[i]=abs(num[i]-num[i+1]);
		}
	}
	LL res1=-INF,res2=-INF,tmp=0ll,l=0;
	for(int i=0;i<n-1;i++)
	{
		tmp+=b[i];
		if(tmp>res1)
			res1=tmp;
		if(tmp<0)
			tmp=0;
	}
	tmp=0ll;
	for(int i=0;i<n-1;i++)
	{
		tmp+=c[i];
		if(tmp>res2)
			res2=tmp;
		if(tmp<0)
			tmp=0;
	}
	printf("%I64d\n",max(res1,res2));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		if(tmp>res)
			res=tmp;
		while(tmp<0)
		{
			tmp=-(tmp-abs(num[l]-num[l+1]));
			l++;
		}
	}
	printf("%I64d\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N],b[N],c[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	for(int i=0;i<n-1;i++)
	{
		if(i%2)
		{
			b[i]=abs(num[i]-num[i+1]);
			c[i]=-abs(num[i]-num[i+1]);
		}
		else
		{
			b[i]=-abs(num[i]-num[i+1]);
			c[i]=abs(num[i]-num[i+1]);
		}
	}
	LL res1=-INF,res2=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		tmp+=b[i];
		if(tmp>res1)
			res1=tmp;
		if(tmp<0)
			tmp=0;
	}
	tmp=0;
	for(int i=0;i<n-1;i++)
	{
		tmp+=c[i];
		if(tmp>res2)
			res2=tmp;
		if(tmp<0)
			tmp=0;
	}
	printf("%I64d\n",max(res1,res2));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N],b[N],c[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	for(int i=0;i<n;i++)
	{
		if(i%2)
		{
			b[i]=abs(num[i]-num[i+1]);
			c[i]=-abs(num[i]-num[i+1]);
		}
		else
		{
			b[i]=-abs(num[i]-num[i+1]);
			c[i]=abs(num[i]-num[i+1]);
		}
	}
	LL res1=-INF,res2=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		tmp+=b[i];
		if(tmp>res1)
			res1=tmp;
		if(tmp<0)
			tmp=0;
	}
	tmp=0;
	for(int i=0;i<n-1;i++)
	{
		tmp+=c[i];
		if(tmp>res2)
			res2=tmp;
		if(tmp<0)
			tmp=0;
	}
	printf("%d\n",max(res1,res2));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		if(tmp>res)
			res=tmp;
		if(tmp<0)
		{
			tmp=0;
			l=i+1;
		}
	}
	printf("%d\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		if(tmp>res)
			res=tmp;
		while(tmp<0)
		{
			tmp=-(tmp-abs(num[l]-num[l+1]));
			res=max(tmp,res);
			l++;
		}
	}

	printf("%I64d\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005

int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0,r=0;
	for(int i=0;i<n-1;i++)
	{

		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		r=i;
		//cout<<l<<' '<<r<<' '<<tmp<<endl;
		if(tmp>res)
			res=tmp;
		while(tmp<0&&l<r)
		{
			tmp=-(tmp-abs(num[l]-num[l+1]));
			res=max(tmp,res);
			l++;
			//cout<<l<<' '<<r<<' '<<tmp<<endl;
		}
	}
	//cout<<endl;
	while(l<r)
	{
		tmp=-(tmp-abs(num[l]-num[l+1]));
		res=max(tmp,res);
		l++;
		//cout<<l<<' '<<r<<' '<<tmp<<endl;
	}
	printf("%I64d\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define LL long long
#define INF 10000000005
int num[N];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&num[i]);
	LL res=-INF,tmp=0,l=0;
	for(int i=0;i<n-1;i++)
	{
		if((i-l+2)%2)
			tmp+=abs(num[i]-num[i+1])*-1;
		else
			tmp+=abs(num[i]-num[i+1]);
		if(tmp>res)
			res=tmp;
		if(tmp<0)
		{
			tmp=0;
			l=i;
			i--;
		}
	}
	printf("%d\n",res);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = (int)1e5+5;
long long a[maxn], b[maxn];
int n;

int main()
{
    while(~scanf("%d", &n)){
        for(int i = 0; i < n; ++i)  scanf("%I64d", &a[i]);
        for(int i = 0; i < n-1; ++i) b[i] = abs(a[i]-a[i+1]);
        long long a1 = 0, a2 = 0;
        long long t = 0;
        for(int i = 0; i < n-1; ++i){
            if(!(i&1)) {
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a1 = max(a1, t);
        }
        t = 0;
        for(int i = 1; i < n-1; ++i){
            if(i&1){
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a2 = max(a1, t);
        }
        printf("%I64d\n", max(a1, a2));
    }
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = (int)1e5+5;
long long a[maxn], b[maxn];
int n;

int main()
{
    while(~scanf("%d", &n)){
        for(int i = 0; i < n; ++i)  scanf("%I64d", &a[i]);
        for(int i = 0; i < n-1; ++i) b[i] = abs(a[i]-a[i+1]);
        long long a1 = 0, a2 = 0;
        long long t = 0;
        for(int i = 0; i < n-1; ++i){
            if(!(i&1)) {
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a1 = max(a1, t);
        }
        t = 0;
        for(int i = 1; i < n-1; ++i){
            if(i&1){

                t+=b[i];
            } else {
                #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = (int)1e5+5;
long long a[maxn], b[maxn];
int n;

int main()
{
    while(~scanf("%d", &n)){
        for(int i = 0; i < n; ++i)  scanf("%I64d", &a[i]);
        for(int i = 0; i < n-1; ++i) b[i] = abs(a[i]-a[i+1]);
        long long a1 = 0, a2 = 0;
        long long t = 0;
        for(int i = 0; i < n-1; ++i){
            if(!(i&1)) {
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a1 = max(a1, t);
        }
        t = 0;
        for(int i = 1; i < n-1; ++i){
            if(i&1){

                t+=b[i];
            } else {
                if(t < 0) t = 0;
                t-=b[i];
            }
            a2 = max(a1, t);
        }
        printf("%I64d\n", max(a1, a2));
    }
}

                t-=b[i];
            }
            a2 = max(a1, t);
        }
        printf("%I64d\n", max(a1, a2));
    }
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = (int)1e5+5;
long long a[maxn], b[maxn];
int n;

int main()
{
    while(~scanf("%d", &n)){
        for(int i = 0; i < n; ++i)  scanf("%I64d", &a[i]);
        for(int i = 0; i < n-1; ++i) b[i] = abs(a[i]-a[i+1]);
        long long a1 = 0, a2 = 0;
        long long t = 0;
        for(int i = 0; i < n-1; ++i){
            if(!(i&1)) {
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a1 = max(a1, t);
        }
        t = 0;
        for(int i = 1; i < n-1; ++i){
            if(i&1){
                t+=b[i];
            } else {
                if(t < 0) t = 0;
                t-=b[i];
            }
            a2 = max(a1, t);
        }
        printf("%I64d\n", max(a1, a2));
    }
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = (int)1e5+5;
long long a[maxn], b[maxn];
int n;

int main()
{
    while(~scanf("%d", &n)){
        for(int i = 0; i < n; ++i)  scanf("%I64d", &a[i]);
        for(int i = 0; i < n-1; ++i) b[i] = abs(a[i]-a[i+1]);
        long long a1 = 0, a2 = 0;
        long long t = 0;
        for(int i = 0; i < n-1; ++i){
            if(i%2==0) {
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a1 = max(a1, t);
        }
        t = 0;
        for(int i = 0; i < n-1; ++i){
            if(i%2==1){
                if(t < 0) t = 0;
                t+=b[i];
            } else {
                t-=b[i];
            }
            a2 = max(a1, t);
        }
        printf("%I64d\n", max(a1, a2));
    }
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = (int)1e5+5;
int n, a[maxn], b[maxn];

int main()
{
    while(~scanf("%d", &n)){
        for(int i = 0; i < n; ++i)  scanf("%d", &a[i]);
        for(int i = 0; i < n-1; ++i) b[i] = abs(a[i]-a[i+1]);
        int a1 = 0, a2 = 0;
        int t = 0;
        for(int i = 0; i < n-1; ++i){
            if(!(i&1)) {
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a1 = max(a1, t);
        }
        t = 0;
        for(int i = 1; i < n-1; ++i){
            if(i&1){
                if(t < 0) t = 0;
                t+=b[i];
            } else t-=b[i];

            a2 = max(a1, t);
        }
        printf("%d\n", max(a1, a2));
    }
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = (int)1e5+5;
long long a[maxn], b[maxn], d1[maxn], d2[maxn];
int n;

int main()
{
    scanf("%d", &n);
    for(int i = 0; i < n; ++i) scanf("%I64d", &a[i]);
    for(int i = 0; i < n-1; ++i) b[i] = abs(a[i]-a[i+1]);
    for(int i = n-2; i >= 0; --i){
        if(i%2 == 0){  // 偶数 +
            d1[i] = max(b[i], d1[i+1]+b[i]);
        } else {
            d1[i] = max(-b[i], d1[i+1]-b[i]);
        }
    }
    for(int i = n-2; i >= 0; --i){
        if(i%2 == 1){  // 奇数正;
            d2[i] = max(b[i], d2[i+1]+b[i]);
        } else {
            d2[i] = max(-b[i], d2[i+1]-b[i]);
        }
    }
    long long ans = -1e9;
    for(int i = 0; i < n-1; ++i){
        if(i&1){
            ans = max(ans, d2[i]);
        } else {
            ans = max(ans, d1[i]);
        }
    }
    printf("%I64d\n", ans);
}


/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 92203685477580799
#define I_MIN -92203685477580799
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)        cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f)     cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;

    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a)%MOD;
        a = (a * a)%MOD;
        b >>= 1;
    }

    return (res%MOD);
}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_2(10, j) * ( st[i] - '0' ) );
       j++;
    }

    return numb;
}
ll baseno_to_decimal( string st, ll basee )
{
    ll i = 0, j, anss = 0;
    rrep(j, (int)st.length()-1, 0)
    {
        anss += ( st[j] - '0' ) * pow_2( basee, i );
        i++;
    }

    return anss;
}
string decimal_to_string( ll num, ll basee )
{
    ll i = 0, j, opop;
    string anss = "";
    vector< string > stri;
    stri.pb("0"); stri.pb("1"); stri.pb("2"); stri.pb("3");
    stri.pb("4"); stri.pb("5"); stri.pb("6"); stri.pb("7");
    stri.pb("8"); stri.pb("9"); stri.pb("A"); stri.pb("B");
    stri.pb("C"); stri.pb("D"); stri.pb("E"); stri.pb("F");
    if( num==0 )
    {
        return "0";
    }
    while( num )
    {
        opop = num%basee;
        anss += stri[opop];
        num /= basee;
    }
    reverse( all(anss) );

    return anss;
}
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
// Always use double and never float.
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.
// For Directed Acyclic Graph, DFS without marking visited vertices could lead to TLE( exponential solution ).

ll arr[100010];
vector<ll> vc;
int main()
{
    #ifndef  ONLINE_JUDGE
       freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll N, i, j, ans = 0, pp = 0, rere = 0;
    string st;

    cin >> N;
    rep(i, 1, N)
    {
        cin >> arr[i];
    }

    rep(i, 1, N-1)
    {
        if( ( rere + ( pow_2(-1, pp) * abs( arr[i]-arr[i+1] ) ) ) >0 )
        {
           rere =  ( rere + ( pow_2(-1, pp)*abs( arr[i]-arr[i+1] ) ) );
           pp++;
           ans = max( rere, ans );
        }
        else
        {
           pp = 0;
           rere = 0;
           if( !arr[i] && !arr[i+1] )
           {
               continue;
           }
           i--;
        }
        //trace2(ans, i)
    }

    cout << ans;

    return 0;
}


/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 92203685477580799
#define I_MIN -92203685477580799
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)        cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f)     cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;

    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a)%MOD;
        a = (a * a)%MOD;
        b >>= 1;
    }

    return (res%MOD);
}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_2(10, j) * ( st[i] - '0' ) );
       j++;
    }

    return numb;
}
ll baseno_to_decimal( string st, ll basee )
{
    ll i = 0, j, anss = 0;
    rrep(j, (int)st.length()-1, 0)
    {
        anss += ( st[j] - '0' ) * pow_2( basee, i );
        i++;
    }

    return anss;
}
string decimal_to_string( ll num, ll basee )
{
    ll i = 0, j, opop;
    string anss = "";
    vector< string > stri;
    stri.pb("0"); stri.pb("1"); stri.pb("2"); stri.pb("3");
    stri.pb("4"); stri.pb("5"); stri.pb("6"); stri.pb("7");
    stri.pb("8"); stri.pb("9"); stri.pb("A"); stri.pb("B");
    stri.pb("C"); stri.pb("D"); stri.pb("E"); stri.pb("F");
    if( num==0 )
    {
        return "0";
    }
    while( num )
    {
        opop = num%basee;
        anss += stri[opop];
        num /= basee;
    }
    reverse( all(anss) );

    return anss;
}
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
// Always use double and never float.
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.
// For Directed Acyclic Graph, DFS without marking visited vertices could lead to TLE( exponential solution ).

ll arr[100010];
vector<ll> vc;
int main()
{
    #ifndef  ONLINE_JUDGE
       freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll N, i, j, K, T, L, R, ans = 0, pp = 0, rere = 0;
    string st;

    cin >> N;
    rep(i, 1, N)
    {
        cin >> arr[i];
    }

    //trace1( pow_2(-1, 1) )

    rep(i, 1, N-1)
    {
        if( ( rere + ( pow_2(-1, pp)*abs( arr[i]-arr[i+1] ) ) ) >=0 )
        {
           rere =  ( rere + ( pow_2(-1, pp)*abs( arr[i]-arr[i+1] ) ) );
           pp++;
           ans = max( rere, ans );
        }
        else
        {
           pp = 0;
           rere = 0;
           i--;
        }
        //trace2(ans, i)
    }

    cout << ans;

    return 0;
}


/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 92203685477580799
#define I_MIN -92203685477580799
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)        cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f)     cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;

    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a)%MOD;
        a = (a * a)%MOD;
        b >>= 1;
    }

    return (res%MOD);
}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_2(10, j) * ( st[i] - '0' ) );
       j++;
    }

    return numb;
}
ll baseno_to_decimal( string st, ll basee )
{
    ll i = 0, j, anss = 0;
    rrep(j, (int)st.length()-1, 0)
    {
        anss += ( st[j] - '0' ) * pow_2( basee, i );
        i++;
    }

    return anss;
}
string decimal_to_string( ll num, ll basee )
{
    ll i = 0, j, opop;
    string anss = "";
    vector< string > stri;
    stri.pb("0"); stri.pb("1"); stri.pb("2"); stri.pb("3");
    stri.pb("4"); stri.pb("5"); stri.pb("6"); stri.pb("7");
    stri.pb("8"); stri.pb("9"); stri.pb("A"); stri.pb("B");
    stri.pb("C"); stri.pb("D"); stri.pb("E"); stri.pb("F");
    if( num==0 )
    {
        return "0";
    }
    while( num )
    {
        opop = num%basee;
        anss += stri[opop];
        num /= basee;
    }
    reverse( all(anss) );

    return anss;
}
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
// Always use double and never float.
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.
// For Directed Acyclic Graph, DFS without marking visited vertices could lead to TLE( exponential solution ).

ll arr[100010];
vector<ll> vc;
int main()
{
    #ifndef  ONLINE_JUDGE
       freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll N, i, j, ans = 0, pp = 0, rere = 0;
    string st;

    cin >> N;
    rep(i, 1, N)
    {
        cin >> arr[i];
    }

    rep(i, 1, N-1)
    {
        if( ( rere + ( pow_2(-1, pp) * abs( arr[i]-arr[i+1] ) ) ) >= abs( arr[i]-arr[i+1] ) )
        {
           rere = rere + ( pow_2(-1, pp) * abs( arr[i]-arr[i+1] ) );
           pp++;
        }
        else
        {
           pp = 1;
           rere = abs( arr[i]-arr[i+1] );
        }
        ans = max( rere, ans );
    }

    cout << ans;

    return 0;
}


/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 92203685477580799
#define I_MIN -92203685477580799
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)        cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f)     cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;

    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a)%MOD;
        a = (a * a)%MOD;
        b >>= 1;
    }

    return (res%MOD);
}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_2(10, j) * ( st[i] - '0' ) );
       j++;
    }

    return numb;
}
ll baseno_to_decimal( string st, ll basee )
{
    ll i = 0, j, anss = 0;
    rrep(j, (int)st.length()-1, 0)
    {
        anss += ( st[j] - '0' ) * pow_2( basee, i );
        i++;
    }

    return anss;
}
string decimal_to_string( ll num, ll basee )
{
    ll i = 0, j, opop;
    string anss = "";
    vector< string > stri;
    stri.pb("0"); stri.pb("1"); stri.pb("2"); stri.pb("3");
    stri.pb("4"); stri.pb("5"); stri.pb("6"); stri.pb("7");
    stri.pb("8"); stri.pb("9"); stri.pb("A"); stri.pb("B");
    stri.pb("C"); stri.pb("D"); stri.pb("E"); stri.pb("F");
    if( num==0 )
    {
        return "0";
    }
    while( num )
    {
        opop = num%basee;
        anss += stri[opop];
        num /= basee;
    }
    reverse( all(anss) );

    return anss;
}
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
// Always use double and never float.
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.
// For Directed Acyclic Graph, DFS without marking visited vertices could lead to TLE( exponential solution ).

ll arr[100010], arr2[4][100010], N;
vector<ll> vc;

ll kadane( ll ind )
{
    ll i, j, rere = 0, ans = 0;

    rep(i, 1, N-1)
    {
        rere = max( rere + arr2[ind][i], arr2[ind][i] );
        rere = max( rere, 0 );
        ans = max( rere, ans );

        //trace3(i, ind, rere)
    }

    return ans;
}
int main()
{
    #ifndef  ONLINE_JUDGE
       freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll i, j;
    string st;

    cin >> N;
    rep(i, 1, N)
    {
        cin >> arr[i];
    }

    rep(i, 1, N-1)
    {
        arr2[1][i] = abs(arr[i] - arr[i+1]);
        arr2[2][i] = abs(arr[i] - arr[i+1]);

        if( i%2 )
        {
            arr2[1][i] = -arr2[1][i];
        }
        else
        {
            arr2[2][i] = -arr2[2][i];
        }

        //trace2(arr2[1][i], arr2[2][i])
    }

    ll val1 = kadane(1), val2 = kadane(2);
    cout << max(val1, val2);

    return 0;
}


/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 92203685477580799
#define I_MIN -92203685477580799
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)        cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f)     cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;

    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a)%MOD;
        a = (a * a)%MOD;
        b >>= 1;
    }

    return (res%MOD);
}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_2(10, j) * ( st[i] - '0' ) );
       j++;
    }

    return numb;
}
ll baseno_to_decimal( string st, ll basee )
{
    ll i = 0, j, anss = 0;
    rrep(j, (int)st.length()-1, 0)
    {
        anss += ( st[j] - '0' ) * pow_2( basee, i );
        i++;
    }

    return anss;
}
string decimal_to_string( ll num, ll basee )
{
    ll i = 0, j, opop;
    string anss = "";
    vector< string > stri;
    stri.pb("0"); stri.pb("1"); stri.pb("2"); stri.pb("3");
    stri.pb("4"); stri.pb("5"); stri.pb("6"); stri.pb("7");
    stri.pb("8"); stri.pb("9"); stri.pb("A"); stri.pb("B");
    stri.pb("C"); stri.pb("D"); stri.pb("E"); stri.pb("F");
    if( num==0 )
    {
        return "0";
    }
    while( num )
    {
        opop = num%basee;
        anss += stri[opop];
        num /= basee;
    }
    reverse( all(anss) );

    return anss;
}
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
// Always use double and never float.
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.
// For Directed Acyclic Graph, DFS without marking visited vertices could lead to TLE( exponential solution ).

ll arr[100010];
vector<ll> vc;
int main()
{
    #ifndef  ONLINE_JUDGE
       freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll N, i, j, ans = 0, pp = 0, rere = 0;
    string st;

    cin >> N;
    rep(i, 1, N)
    {
        cin >> arr[i];
    }

    rep(i, 1, N-1)
    {
        if( ( rere + ( pow_2(-1, pp) * abs( arr[i]-arr[i+1] ) ) ) > abs( arr[i]-arr[i+1] ) )
        {
           rere =  rere + ( pow_2(-1, pp)*abs( arr[i]-arr[i+1] ) );
           pp++;
        }
        else
        {
           pp = 1;
           rere = abs( arr[i]-arr[i+1] );
        }
        ans = max( rere, ans );
    }

    cout << ans;

    return 0;
}


/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 92203685477580799
#define I_MIN -92203685477580799
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)        cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f)     cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;

    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a)%MOD;
        a = (a * a)%MOD;
        b >>= 1;
    }

    return (res%MOD);
}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_2(10, j) * ( st[i] - '0' ) );
       j++;
    }

    return numb;
}
ll baseno_to_decimal( string st, ll basee )
{
    ll i = 0, j, anss = 0;
    rrep(j, (int)st.length()-1, 0)
    {
        anss += ( st[j] - '0' ) * pow_2( basee, i );
        i++;
    }

    return anss;
}
string decimal_to_string( ll num, ll basee )
{
    ll i = 0, j, opop;
    string anss = "";
    vector< string > stri;
    stri.pb("0"); stri.pb("1"); stri.pb("2"); stri.pb("3");
    stri.pb("4"); stri.pb("5"); stri.pb("6"); stri.pb("7");
    stri.pb("8"); stri.pb("9"); stri.pb("A"); stri.pb("B");
    stri.pb("C"); stri.pb("D"); stri.pb("E"); stri.pb("F");
    if( num==0 )
    {
        return "0";
    }
    while( num )
    {
        opop = num%basee;
        anss += stri[opop];
        num /= basee;
    }
    reverse( all(anss) );

    return anss;
}
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
// Always use double and never float.
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.
// For Directed Acyclic Graph, DFS without marking visited vertices could lead to TLE( exponential solution ).

ll arr[100010];
vector<ll> vc;
int main()
{
    #ifndef  ONLINE_JUDGE
       freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll N, i, j, ans = 0, pp = 0, rere = 0;
    string st;

    cin >> N;
    rep(i, 1, N)
    {
        cin >> arr[i];
    }

    rep(i, 1, N-1)
    {
        if( ( rere + ( pow_2(-1, pp) * abs( arr[i]-arr[i+1] ) ) ) >0 )
        {
           rere =  ( rere + ( pow_2(-1, pp)*abs( arr[i]-arr[i+1] ) ) );
           pp++;
           ans = max( rere, ans );
        }
        else
        {
           pp = 0;
           rere = 0;
           if( !abs(arr[i]-arr[i+1]) )
           {
               continue;
           }
           i--;
        }
        //trace2(ans, i)
    }

    cout << ans;

    return 0;
}


/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 92203685477580799
#define I_MIN -92203685477580799
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)        cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f)     cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;

    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a)%MOD;
        a = (a * a)%MOD;
        b >>= 1;
    }

    return (res%MOD);
}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_2(10, j) * ( st[i] - '0' ) );
       j++;
    }

    return numb;
}
ll baseno_to_decimal( string st, ll basee )
{
    ll i = 0, j, anss = 0;
    rrep(j, (int)st.length()-1, 0)
    {
        anss += ( st[j] - '0' ) * pow_2( basee, i );
        i++;
    }

    return anss;
}
string decimal_to_string( ll num, ll basee )
{
    ll i = 0, j, opop;
    string anss = "";
    vector< string > stri;
    stri.pb("0"); stri.pb("1"); stri.pb("2"); stri.pb("3");
    stri.pb("4"); stri.pb("5"); stri.pb("6"); stri.pb("7");
    stri.pb("8"); stri.pb("9"); stri.pb("A"); stri.pb("B");
    stri.pb("C"); stri.pb("D"); stri.pb("E"); stri.pb("F");
    if( num==0 )
    {
        return "0";
    }
    while( num )
    {
        opop = num%basee;
        anss += stri[opop];
        num /= basee;
    }
    reverse( all(anss) );

    return anss;
}
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
// Always use double and never float.
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.
// For Directed Acyclic Graph, DFS without marking visited vertices could lead to TLE( exponential solution ).

ll arr[100010];
vector<ll> vc;
int main()
{
    #ifndef  ONLINE_JUDGE
       freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll N, i, j, ans = 0, pp = 0, rere = 0;
    string st;

    cin >> N;
    rep(i, 1, N)
    {
        cin >> arr[i];
    }

    rep(i, 1, N-1)
    {
        if( ( rere + ( pow_2(-1, pp) * ( max(arr[i],arr[i+1]) - min(arr[i],arr[i+1]) ) ) ) >= ( max(arr[i],arr[i+1]) - min(arr[i],arr[i+1]) ) )
        {
           rere = rere + ( pow_2(-1, pp) * ( max(arr[i],arr[i+1]) - min(arr[i],arr[i+1]) ) );
           pp++;
        }
        else
        {
           pp = 1;
           rere = ( max(arr[i],arr[i+1]) - min(arr[i],arr[i+1]) );
        }
        ans = max( rere, ans );
    }

    cout << ans;

    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}}

int n;
ll a[100100],b[100100];

int main()
{
    scanf("%d",&n);
    F(i,1,n) scanf("%lld",a+i);
    F(i,1,n-1) b[i]=abs(a[i]-a[i+1]);
    ll ans=0,ret=0;
    int flag=1;
    F(i,1,n-1)
    {
        //printf("flag=%d\n",flag);
        ret+=b[i]*flag;flag=-1*flag;
        //printf("flag=%d\n",flag);
        if(ret<0) { ret=b[i];flag=-1; }
        ans=max(ans,ret);
    }
    flag=1;ret=0;
    F(i,2,n-1)
    {
        ret+=b[i]*flag;flag=-flag;
        if(ret<0) { ret=b[i];flag=-1; }
        ans=max(ans,ret);
    }
    printf("%lld\n",ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}}

int n;
ll a[100100],b[100100];

int main()
{
    scanf("%d",&n);
    F(i,1,n) scanf("%lld",a+i);
    F(i,1,n-1) if(i%2==0) b[i]=-abs(a[i]-a[i+1]);else b[i]=abs(a[i]-a[i+1]);
    ll ans=0,ret=0;
    F(i,1,n-1)
    {
        //printf("flag=%d\n",flag);
        ret+=b[i];
        //printf("flag=%d\n",flag);
        if(ret<0) ret=b[i];
        ans=max(ans,ret);
    }
    ret=0;
    F(i,2,n-1)
    {
        ret-=b[i];
        if(ret<0) ret=b[i];
        ans=max(ans,ret);
    }
    printf("%lld\n",ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}}

int n;
ll a[100100],b[100100];

int main()
{
    scanf("%d",&n);
    F(i,1,n) scanf("%lld",a+i);
    F(i,1,n-1) if(i%2==0) b[i]=-abs(a[i]-a[i+1]);else b[i]=abs(a[i]-a[i+1]);
    //F(i,1,n-1) printf("%d%c",b[i],i==n-1?'\n':' ');
    ll ans=0,ret=0;
    F(i,1,n-1)
    {
        //printf("flag=%d\n",flag);
        ret+=b[i];
        //printf("flag=%d\n",flag);
        if(ret<0) ret=b[i];
        ans=max(ans,ret);
    }
    ret=0;
    F(i,2,n-1)
    {
        ret-=b[i];
        if(ret<0) ret=b[i];
        ans=max(ans,ret);
    }
    printf("%lld\n",ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}}

int n;
ll a[100100],b[100100];

int main()
{
    scanf("%d",&n);
    F(i,1,n) scanf("%lld",a+i);
    int rp = 1;
    ll ans = 0,ret;
    F(i,1,n-1) {b[i]=abs(a[i]-a[i+1]);ans=max(ans,b[i]);}
    ret=-b[1];
    for(int lp = 1; lp <= n; lp++)
    {
        ret=-ret+b[lp-1];
        ans=max(ans,ret);
        while(ret>=0)
        {
            if(rp>n) break;
                 rp++;
                 if((rp-lp)&1) ret-=b[rp];else ret+=b[rp];
                 ans=max(ans,ret);
        }
    }
    printf("%lld\n",ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}}

int n;
ll a[100100],b[100100];

int main()
{
    scanf("%d",&n);
    F(i,1,n) scanf("%lld",a+i);
    F(i,1,n-1) if(i%2==0) b[i]=-abs(a[i]-a[i+1]);else b[i]=abs(a[i]-a[i+1]);
    //F(i,1,n-1) printf("%lld%c",b[i],i==n-1?'\n':' ');
    ll ans=0,ret=0;
    F(i,1,n-1)
    {
        //printf("flag=%d\n",flag);
        ret+=b[i];
        //printf("flag=%d\n",flag);
        if(ret<0) ret=b[i];
        ans=max(ans,ret);
    }
    //printf("%lld\n",ans);
    ret=0;
    F(i,2,n-1)
    {
       //printf("%lld%c",-b[i],i==n-1?'\n':' ');
        ret+=(-b[i]);
        if(ret<0) ret=-b[i];
        ans=max(ans,ret);
    }
    printf("%lld\n",ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}}

int n;
ll a[100100],b[100100];

int main()
{
    scanf("%d",&n);
    F(i,1,n) scanf("%lld",a+i);
    F(i,1,n-1) if(i%2==0) b[i]=-abs(a[i]-a[i+1]);else b[i]=abs(a[i]-a[i+1]);
    //F(i,1,n-1) printf("%lld%c",b[i],i==n-1?'\n':' ');
    ll ans=0,ret=0;
    F(i,1,n-1)
    {
        //printf("flag=%d\n",flag);
        ret+=b[i];
        //printf("flag=%d\n",flag);
        if(ret<0) ret=b[++i];
        ans=max(ans,ret);
    }
    //printf("%lld\n",ans);
    ret=0;
    F(i,2,n-1)
    {
       //printf("%lld%c",-b[i],i==n-1?'\n':' ');
        ret+=-b[i];
        if(ret<0) ret=-b[++i];
        ans=max(ans,ret);
    }
    printf("%lld\n",ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(b))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}}

int n;
ll a[100100],b[100100];

int main()
{
    scanf("%d",&n);
    F(i,1,n) scanf("%lld",a+i);
    F(i,1,n-1) if(i&1) b[i]=-abs(a[i]-a[i+1]);else b[i]=abs(a[i]-a[i+1]);
    ll ans=0,ret=0;
    F(i,1,n-1)
    {
        //printf("flag=%d\n",flag);
        ret+=b[i];
        //printf("flag=%d\n",flag);
        if(ret<0) ret=b[i];
        ans=max(ans,ret);
    }
    ret=0;
    F(i,2,n-1)
    {
        ret-=b[i];
        if(ret<0) ret=b[i];
        ans=max(ans,ret);
    }
    printf("%lld\n",ans);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
//typedef long long ll;
const int maxn=100005;
int main()
{   long long a[maxn];
   long long   sum[maxn];
    long long sum1[maxn];
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {   scanf("%lld",&a[i]);
    }
    int j=1;
    for(int i=2;i<=n;i++)
    {   sum[j++]=a[i]-a[i-1];

    }
    for(int i=1;i<=n-1;i++)
      {   sum1[i]=-sum[i];

      }
      n--;
      long long  all=0;
      long long maxsize=-0x3f3f3f3f;
      for(int i=1;i<=n;i++)
      {     if(all+sum[i]<sum[i])
              all=sum[i];
              else
                all+=sum[i];
            if(maxsize<all)
                maxsize=all;

      }
      all=0;
      for(int i=1;i<=n;i++)
      {   if(all+sum1[i]<sum1[i])
           all=sum[i];
          else
            all+=sum[i];
          if(maxsize<all)
          maxsize=all;

      }

       printf("%lld\n",maxsize);

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
//typedef long long ll;
const int maxn=100005;
int main()
{   long long a[maxn];
   long long   sum[maxn];
    long long sum1[maxn];
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {   scanf("%lld",&a[i]);
    }
    int j=1;
    for(int i=2;i<=n;i++)
    {   sum[j++]=a[i]-a[i-1];

    }
    for(int i=1;i<=n-1;i++)
      {   sum1[i]=-sum[i];

      }
      n--;
      int all=0;
      int maxsize=-999;
      for(int i=1;i<=n;i++)
      {     if(all+sum[i]<sum[i])
              all=sum[i];
              else
                all+=sum[i];
            if(maxsize<all)
                maxsize=all;

      }
      all=0;
      for(int i=1;i<=n;i++)
      {   if(all+sum1[i]<sum1[i])
           all=sum[i];
          else
            all+=sum[i];
          if(maxsize<all)
          maxsize=all;

      }

       printf("%d\n",maxsize);

    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{    int m;
    int a[100005];
    scanf("%d",&m);
     for(int i=1;i<=m;i++)
     {   scanf("%d",&a[i]);
     }
    sort(a+1,a+m+1);
      printf("%d\n",a[m]-a[1]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
//typedef long long ll;
const int maxn=100005;
int main()
{   long long a[maxn];
   long long   sum[maxn];
    long long sum1[maxn];
    long long sum2[maxn];
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {   scanf("%lld",&a[i]);
    }
    int j=1;
    for(int i=2;i<=n;i++)
    {   sum[j++]=abs(a[i]-a[i-1]);

    }
    //for(int i=1;i<=n-1;i++)
        //printf("  %d ",sum[i]);
    for(int i=1;i<=n-1;i++)
      {   if(i%2)
          {sum1[i]=sum[i];
           sum2[i]=-sum[i];
          }
          else
            {sum1[i]=-sum[i];
              sum2[i]=sum[i];
            }
      }
      n--;
      long long  all=0;
      long long maxsize=-0x3f3f3f3f;
      for(int i=1;i<=n;i++)
      {     if(all+sum2[i]<sum2[i])
              all=sum2[i];
              else
                all+=sum2[i];
            if(maxsize<all)
                maxsize=all;

      }
      all=0;
      for(int i=1;i<=n;i++)
      {   if(all+sum1[i]<sum1[i])
           all=sum1[i];
          else
            all+=sum1[i];
          if(maxsize<all)
          maxsize=all;

      }

       printf("%lld\n",maxsize);

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
//typedef long long ll;
const int maxn=100005;
int main()
{   long long a[maxn];
   long long   sum[maxn];
    long long sum1[maxn];
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {   scanf("%lld",&a[i]);
    }
    int j=1;
    for(int i=2;i<=n;i++)
    {   sum[j++]=a[i]-a[i-1];

    }
    for(int i=1;i<=n-1;i++)
      {   sum1[i]=-sum[i];

      }
      n--;
      long long  all=0;
      long long maxsize=-0x3f3f3f3f;
      for(int i=1;i<=n;i++)
      {     if(all+sum[i]<sum[i])
              all=sum[i];
              else
                all+=sum[i];
            if(maxsize<all)
                maxsize=all;

      }
      all=0;
      for(int i=1;i<=n;i++)
      {   if(all+sum1[i]<sum1[i])
           all=sum1[i];
          else
            all+=sum1[i];
          if(maxsize<all)
          maxsize=all;

      }

       printf("%lld\n",maxsize);

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
const int maxn=100006;
int main()
{   int a[maxn];
    int sum[maxn];
    int sum1[maxn];
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {   scanf("%d",&a[i]);
    }
    int j=1;
    for(int i=2;i<=n;i++)
    {   sum[j++]=a[i]-a[i-1];

    }
    for(int i=1;i<=n-1;i++)
      {   sum1[i]=-sum[i];

      }
      n--;
      int all=0;
      int maxsize=-999;
      for(int i=1;i<=n;i++)
      {     if(all+sum[i]<sum[i])
              all=sum[i];
              else
                all+=sum[i];
            if(maxsize<all)
                maxsize=all;

      }
      all=0;
      for(int i=1;i<=n;i++)
      {   if(all+sum1[i]<sum1[i])
           all=sum[i];
          else
            all+=sum[i];
          if(maxsize<all)
          maxsize=all;

      }

       printf("%d\n",maxsize);

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
//typedef long long ll;
const int maxn=100005;
int main()
{   long long a[maxn];
   long long   sum[maxn];
    long long sum1[maxn];
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {   scanf("%lld",&a[i]);
    }
    int j=1;
    for(int i=2;i<=n;i++)
    {   sum[j++]=a[i]-a[i-1];

    }
    for(int i=1;i<=n-1;i++)
      {   sum1[i]=-sum[i];

      }
      n--;
      int all=0;
      int maxsize=-0x3f3f3f3f;
      for(int i=1;i<=n;i++)
      {     if(all+sum[i]<sum[i])
              all=sum[i];
              else
                all+=sum[i];
            if(maxsize<all)
                maxsize=all;

      }
      all=0;
      for(int i=1;i<=n;i++)
      {   if(all+sum1[i]<sum1[i])
           all=sum[i];
          else
            all+=sum[i];
          if(maxsize<all)
          maxsize=all;

      }

       printf("%d\n",maxsize);

    return 0;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1e5+10;

long long t[4*N], tt[4*N], mx, v[N], v1[N];

void build(int tl, int tr, int ver = 1)
{
       if(tl == tr)
       {
            t[ver] = v[tl];
            tt[ver] = v1[tl];
       }
       else
       {
             int tm = (tl + tr) >> 1;
             build(tl, tm, ver + ver);
             build(tm + 1, tr, ver + ver + 1);

             t[ver] = t[ver + ver] + t[ver + ver + 1];
             tt[ver] = tt[ver + ver] + tt[ver + ver + 1];
       }
       mx = max(mx, max(tt[ver], t[ver]));
}
main()
{
        int n;
        cin >> n;

        int a[n];
        for(int i = 0;i < n;i ++)
            scanf("%d", &a[i]);

        for(int i = 0;i < n - 1;i ++){
             v[i] = abs(a[i] - a[i + 1]);
             v1[i] = abs(a[i] - a[i + 1]);
             if(i % 2 == 0)
                 v[i] *= -1;
             else
                 v1[i] *= -1;
        }

        build(0, n - 2);

        cout << mx << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1e5+10;

long long t[4*N], tt[4*N], mx = -1e18, v[N], v1[N];

void build(int tl, int tr, int ver = 1)
{
       if(tl == tr)
       {
            t[ver] = v[tl];
            tt[ver] = v1[tl];
       }
       else
       {
             int tm = (tl + tr) >> 1;
             build(tl, tm, ver + ver);
             build(tm + 1, tr, ver + ver + 1);

             t[ver] = t[ver + ver] + t[ver + ver + 1];
             tt[ver] = tt[ver + ver] + tt[ver + ver + 1];
       }
       mx = max(mx, max(tt[ver], t[ver]));
}
main()
{
        int n;
        cin >> n;

        int a[n];
        for(int i = 0;i < n;i ++)
            scanf("%d", &a[i]);

        for(int i = 0;i < n - 1;i ++){
             v[i] = abs(a[i] - a[i + 1]);
             v1[i] = abs(a[i] - a[i + 1]);
             if(i % 2 == 0)
                 v[i] *= -1;
             else
                 v1[i] *= -1;
        }

        build(0, n - 2);

        cout << mx << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1e5+10;

int t[4*N], tt[4*N], mx;

int v[N], v1[N];

void build(int tl, int tr, int ver = 1)
{
       if(tl == tr)
       {
            t[ver] = v[tl];
            tt[ver] = v1[tl];
       }
       else
       {
             int tm = (tl + tr) >> 1;
             build(tl, tm, ver + ver);
             build(tm + 1, tr, ver + ver + 1);

             t[ver] = t[ver + ver] + t[ver + ver + 1];
             tt[ver] = tt[ver + ver] + tt[ver + ver + 1];
       }
       mx = max(mx, max(tt[ver], t[ver]));
}
main()
{
        int n;
        cin >> n;

        int a[n];
        for(int i = 0;i < n;i ++)
            scanf("%d", &a[i]);

        for(int i = 0;i < n - 1;i ++){
             v[i] = abs(a[i] - a[i + 1]);
             v1[i] = abs(a[i] - a[i + 1]);
             if(i % 2 == 0)
                 v[i] *= -1;
             else
                 v1[i] *= -1;
        }

        build(0, n - 2);

        cout << mx << endl;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1e5+10;

long long t[4*N], tt[4*N], mx = -1e18, mn = 0, mn2 = 0, v[N], v1[N];

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

        int a[n + 1];
        for(int i = 1;i <= n;i ++)
            scanf("%d", &a[i]);

        for(int i = 1;i < n;i ++){
             v[i] = abs(a[i] - a[i + 1]);
             v1[i] = abs(a[i] - a[i + 1]);
             if(i % 2 == 0)
                 v[i] *= -1;
             else
                 v1[i] *= -1;
             v[i] += v[i - 1];
             v1[i] += v1[i - 1];

             mx = max(mx, v1[i] - mn);
             mx = max(mx, v[i] - mn2);
             mn2 = min(mn2, v[i]);
             mn = min(mn, v1[i]);
        }
        cout << mx;
}


#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1e5+10;

long long t[4*N], tt[4*N], mx = -1e9, v[N], v1[N];

void build(int tl, int tr, int ver = 1)
{
       if(tl == tr)
       {
            t[ver] = v[tl];
            tt[ver] = v1[tl];
       }
       else
       {
             int tm = (tl + tr) >> 1;
             build(tl, tm, ver + ver);
             build(tm + 1, tr, ver + ver + 1);

             t[ver] = t[ver + ver] + t[ver + ver + 1];
             tt[ver] = tt[ver + ver] + tt[ver + ver + 1];
       }
       mx = max(mx, max(tt[ver], t[ver]));
}
main()
{
        int n;
        cin >> n;

        int a[n];
        for(int i = 0;i < n;i ++)
            scanf("%d", &a[i]);

        for(int i = 0;i < n - 1;i ++){
             v[i] = abs(a[i] - a[i + 1]);
             v1[i] = abs(a[i] - a[i + 1]);
             if(i % 2 == 0)
                 v[i] *= -1;
             else
                 v1[i] *= -1;
        }

        build(0, n - 2);

        cout << mx << endl;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
long long n, a[100100], dp[100100][2], mn = -2e18;
long long rec(int i, bool j) {
	if (i == n)return 0;
	long long &ret = dp[i][j], t, e;
	if (~ret)return ret;
	e = abs((a[i] - a[i + 1])), t = e*(j == (i & 1) ? 1 : -1);
	mn = max(max(rec(i + 1, i & 1) + e, e), mn);
	return ret = max(t, t + rec(i + 1, j));
}
int main() {
	memset(dp, -1, sizeof dp);
	cin >> n;
	for (int i = 1; i <= n; ++i)scanf("%lld", a + i);
	rec(1, 1);
	cout << mn;
}


#include <iostream>
#include <algorithm>
using namespace std;
long long n, x, y, a = -2e18, b = -2e18, m, p;
int main() {
	cin >> n >> m;
	while (--n) {
		cin >> p;
		x += abs(m - p)*(n & 1 ? 1 : -1);
		a = max(x, a);
		x = max(0ll, x);
		y += abs(m - p)*(n & 1 ? -1 : 1);
		b = max(y, b);
		y = max(0ll, y);
		m = p;
	}
	cout << max(a, b);
}


#include <iostream>
#include <algorithm>
#include<cstring>
#include <cmath>
using namespace std;
long long n, a[100100], dp[100100][2], mn = -1e18;
long long rec(int i, bool j) {
	if (i == n)return 0;
	long long &ret = dp[i][j], t;
	if (~ret)return ret;
	t = abs((a[i] - a[i + 1]))*(j == (i & 1) ? 1 : -1);
	mn = max(max(rec(i + 1, i & 1) + t, t), mn);
	return ret = max(0ll, t + rec(i + 1, j));
}
int main() {
	memset(dp, -1, sizeof dp);
	cin >> n;
	for (int i = 1; i <= n; ++i)cin >> a[i];
	rec(1, 1);
	cout << mn;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
long long n, a[100100], dp[100100][2], mn = -2e18;
bool db[100100][2];
long long rec(int i, bool j) {
	if (i == n)return 0;
	long long t, e;
	if (db[i][j])return dp[i][j];
	db[i][j] = 1;
	e = abs((a[i] - a[i + 1])), t = e*(j == (i & 1) ? 1 : -1);
	mn = max(max(rec(i + 1, i & 1) + e, e), mn);
	return dp[i][j] = max(t, t + rec(i + 1, j));
}
int main() {
	cin >> n;
	for (int i = 1; i <= n; ++i)scanf("%lld", a + i);
	rec(1, 1);
	cout << mn;
}


#include <iostream>
#include <algorithm>
#include<cstring>
#include <cmath>
using namespace std;
long long n, a[100100], mn = -1e18;
long long rec(int i, bool j) {
	if (i == n)return 0;
	long long t;
	t = abs((a[i] - a[i + 1]))*(j == (i & 1) ? 1 : -1);
	mn = max(max(rec(i + 1, i & 1) + t, t), mn);
	return max(t, t + rec(i + 1, j));
}
int main() {
	cin >> n;
	for (int i = 1; i <= n; ++i)cin >> a[i];
	rec(1, 1);
	cout << mn;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#define RI(N) scanf("%d",&(N))
#define RII(N,M) scanf("%d %d",&(N),&(M))
#define RIII(N,M,K) scanf("%d %d %d",&(N),&(M),&(K))
#define mem(a) memset((a),0,sizeof(a))
using namespace std;

const int inf=1e9;
const int inf1=-1*1e9;
double EPS=1e-10;
typedef long long LL;
const LL mod=1000003;

LL mod_pow(LL x,LL n,LL mod)
{
    LL res=1;
    while(n>0)
    {
        if(n&1) res=((res%mod)*(x%mod))%mod;
        x=((x%mod)*(x%mod))%mod;
        n>>=1;
    }
    return res;
}
long long inv(LL a,LL mod)
{
    return mod_pow(a,mod-2,mod);
}

int main()
{
    LL n,k;

    while(scanf("%I64d %I64d",&n,&k)!=EOF)
    {

        double k1=k;

        double  k2=floor(log(k1)/log(2));
        double k3=log(k1)/log(2);
        if(k3-k2>0)
        {
            LL k4=k2;
            if(k4>=n)
            {
                printf("1 1\n");
                continue;
            }
        }
        else
        {
            LL k4=k2;
            if(k4>n)
            {
                printf("1 1\n");
                continue;
            }

        }
        LL fenzi=0,fenmu=0;
        LL GCD=0;
        LL x=mod_pow(2,n,mod);
        LL t=1;

        while(t<=(k-1))
        {
            t*=2;
            GCD+=(k-1)/t;
        }
        if(k<mod)
        {
            fenzi=1;
            for(LL i=1; i<=k-1; i++)
            {
                LL ex=(x-i+mod)%mod;
                fenzi=(ex*fenzi)%mod;
            }
            fenmu=mod_pow(2,k-1,mod);
            fenmu=mod_pow(fenmu,n,mod);
            fenzi=(fenmu-fenzi+mod)%mod;
            fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
            fenzi=(fenzi*inv(mod_pow(2,GCD,mod),mod))%mod;

        }
        else
        {
            //  cout<<"qq"<<endl;
            fenmu=mod_pow(2,n,mod);
            fenmu=mod_pow(fenmu,k-1,mod);
            fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
            fenzi=fenmu;
        }

        printf("%I64d %I64d\n",fenzi,fenmu);

    }

    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#define RI(N) scanf("%d",&(N))
#define RII(N,M) scanf("%d %d",&(N),&(M))
#define RIII(N,M,K) scanf("%d %d %d",&(N),&(M),&(K))
#define mem(a) memset((a),0,sizeof(a))
using namespace std;

const int inf=1e9;
const int inf1=-1*1e9;
double EPS=1e-10;
typedef long long LL;
const LL mod=1000003;

LL mod_pow(LL x,LL n,LL mod)
{
    LL res=1;
    while(n>0)
    {
        if(n&1) res=((res%mod)*(x%mod))%mod;
        x=((x%mod)*(x%mod))%mod;
        n>>=1;
    }
    return res;
}
long long inv(LL a,LL mod)
{
    return mod_pow(a,mod-2,mod);
}
LL poww(LL x)
{
    LL t=1;
    while(x--)
    {
        t*=2;
    }
    return t;
}
int main()
{
    LL n,k;
    long long q=pow(2,62);
    while(scanf("%I64d %I64d",&n,&k)!=EOF)
    {

        if(n<=62)
        {
            if(poww(n)<k)
            {
                printf("1 1\n");
                continue;
            }
        }
        LL fenzi=0,fenmu=0;
        LL GCD=0;
        LL x=mod_pow(2,n,mod);
        LL t=1;

        while(t<=(k-1))
        {
            t*=2;
            GCD+=(k-1)/t;
        }
        if(k<mod)
        {
            fenzi=1;
            for(LL i=1; i<=k-1; i++)
            {
                LL ex=(x-i+mod)%mod;
                fenzi=(ex*fenzi)%mod;
            }
            fenmu=mod_pow(2,k-1,mod);
            fenmu=mod_pow(fenmu,n,mod);
            fenzi=(fenmu-fenzi+mod)%mod;
            fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
            fenzi=(fenzi*inv(mod_pow(2,GCD,mod),mod))%mod;

        }
        else
        {
            //  cout<<"qq"<<endl;
            fenmu=mod_pow(2,n,mod);
            fenmu=mod_pow(fenmu,k-1,mod);
            fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
            fenzi=fenmu;
        }

        printf("%I64d %I64d\n",fenzi,fenmu);

    }

    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#define RI(N) scanf("%d",&(N))
#define RII(N,M) scanf("%d %d",&(N),&(M))
#define RIII(N,M,K) scanf("%d %d %d",&(N),&(M),&(K))
#define mem(a) memset((a),0,sizeof(a))
using namespace std;

const int inf=1e9;
const int inf1=-1*1e9;
double EPS=1e-10;
typedef long long LL;
const LL mod=1e6+3;

LL mod_pow(LL x,LL n,LL mod)
{
    LL res=1;
    while(n>0)
    {
        if(n&1) res=res*x%mod;
        x=x*x%mod;
        n>>=1;
    }
    return res;
}
long long inv(LL a,LL mod)
{
    return mod_pow(a,mod-2,mod);
}

int main()
{
    LL n,k;

    while(scanf("%I64d %I64d",&n,&k)!=EOF)
    {

        double k1=k;
        LL  k2=floor(log(k1)/log(2));
        if(k2>=n)
        {
            printf("1 1\n");
            continue;
        }
        else
        {
            LL fenzi=0,fenmu=0;
            LL GCD=0;
            LL x=mod_pow(2,n,mod);
            LL t=1;

            while(t<=(k-1))
            {
                t*=2;
                GCD+=(k-1)/t;
                if(t>1e18) break;
            }
            /*cout<<"x = "<<x<<endl;
            cout<<GCD<<endl;*/

            if(k<mod)
            {
                fenzi=1;
                for(LL i=1; i<=k-1; i++)
                {
                    LL ex=(x-i+mod)%mod;
                    fenzi*=ex;
                }
                fenmu=mod_pow(2,k-1,mod);
                fenmu=mod_pow(fenmu,n,mod);
                fenzi=(fenmu-fenzi+mod)%mod;

                //cout<<"fenmu = "<<fenmu<<endl;

                LL niyuan=inv(2,mod);

                for(int i=1; i<=GCD; i++)
                {
                    fenzi=(fenzi*niyuan)%mod;
                    fenmu=(fenmu*niyuan)%mod;
                }

            }
            else
            {
                fenzi=0;
                if(n<GCD)
                {
                    n-=GCD;
                    k+=n;
                    n=0;
                }
                else n-=GCD;
                fenmu=mod_pow(2,k-1,mod);
                fenmu=mod_pow(fenmu,n,mod);
            }

            printf("%I64d %I64d\n",fenzi,fenmu);
        }

    }

    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#define RI(N) scanf("%d",&(N))
#define RII(N,M) scanf("%d %d",&(N),&(M))
#define RIII(N,M,K) scanf("%d %d %d",&(N),&(M),&(K))
#define mem(a) memset((a),0,sizeof(a))
using namespace std;

const int inf=1e9;
const int inf1=-1*1e9;
double EPS=1e-10;
typedef long long LL;
const LL mod=1000003;

LL mod_pow(LL x,LL n,LL mod)
{
    LL res=1;
    while(n>0)
    {
        if(n&1) res=((res%mod)*(x%mod))%mod;
        x=((x%mod)*(x%mod))%mod;
        n>>=1;
    }
    return res;
}
long long inv(LL a,LL mod)
{
    return mod_pow(a,mod-2,mod);
}

int main()
{
    LL n,k;

    while(scanf("%I64d %I64d",&n,&k)!=EOF)
    {

        double k1=k;
        LL  k2=floor(log(k1)/log(2));
        if(k2>=n)
        {
            printf("1 1\n");
            continue;
        }
        else
        {
            LL fenzi=0,fenmu=0;
            LL GCD=0;
            LL x=mod_pow(2,n,mod);
            LL t=1;

            while(t<=(k-1))
            {
                t*=2;
                GCD+=(k-1)/t;
                if(t>1e18) break;
            }
            if(k<mod)
            {
                fenzi=1;
                for(LL i=1; i<=k-1; i++)
                {
                    LL ex=(x-i+mod)%mod;
                    fenzi=(ex*fenzi)%mod;
                }
                fenmu=mod_pow(2,k-1,mod);
                fenmu=mod_pow(fenmu,n,mod);
                fenzi=(fenmu-fenzi+mod)%mod;
                fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
                fenzi=(fenzi*inv(mod_pow(2,GCD,mod),mod))%mod;

            }
            else
            {
                fenmu=mod_pow(2,n,mod);
                fenmu=mod_pow(fenmu,k-1,mod);
                fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
                fenzi=fenmu;
            }

            printf("%I64d %I64d\n",fenzi,fenmu);
        }

    }

    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#define RI(N) scanf("%d",&(N))
#define RII(N,M) scanf("%d %d",&(N),&(M))
#define RIII(N,M,K) scanf("%d %d %d",&(N),&(M),&(K))
#define mem(a) memset((a),0,sizeof(a))
using namespace std;

const int inf=1e9;
const int inf1=-1*1e9;
double EPS=1e-10;
typedef long long LL;
const LL mod=1000003;

LL mod_pow(LL x,LL n,LL mod)
{
    LL res=1;
    while(n>0)
    {
        if(n&1) res=((res%mod)*(x%mod))%mod;
        x=((x%mod)*(x%mod))%mod;
        n>>=1;
    }
    return res;
}
long long inv(LL a,LL mod)
{
    return mod_pow(a,mod-2,mod);
}

int main()
{
    LL n,k;

    while(scanf("%I64d %I64d",&n,&k)!=EOF)
    {

        double k1=k;
        LL  k2=floor(log(k1)/log(2));
        if(k2>=n)
        {
            printf("1 1\n");
            continue;
        }
        else
        {
            LL fenzi=0,fenmu=0;
            LL GCD=0;
            LL x=mod_pow(2,n,mod);
            LL t=1;

            while(t<=(k-1))
            {
                t*=2;
                GCD+=(k-1)/t;
                if(t>1e18) break;
            }
            if(k<mod)
            {
                fenzi=1;
                for(LL i=1; i<=k-1; i++)
                {
                    LL ex=(x-i+mod)%mod;
                    fenzi*=ex;
                }
                fenmu=mod_pow(2,k-1,mod);
                fenmu=mod_pow(fenmu,n,mod);
                fenzi=(fenmu-fenzi+mod)%mod;
                fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
                fenzi=(fenzi*inv(mod_pow(2,GCD,mod),mod))%mod;

            }
            else
            {
                fenmu=mod_pow(2,n,mod);
                fenmu=mod_pow(fenmu,k-1,mod);
                fenmu=(fenmu*inv(mod_pow(2,GCD,mod),mod))%mod;
                fenzi=fenmu;
            }

            printf("%I64d %I64d\n",fenzi,fenmu);
        }

    }

    return 0;
}