Something happened in Uzhlyandia again... There are riots on the streets... Famous Uzhlyandian superheroes Shean the Sheep and Stas the Giraffe were called in order to save the situation. Upon the arriving, they found that citizens are worried about maximum values of the Main Uzhlyandian Function f, which is defined as follows:

<image>

In the above formula, 1 ≤ l < r ≤ n must hold, where n is the size of the Main Uzhlyandian Array a, and |x| means absolute value of x. But the heroes skipped their math lessons in school, so they asked you for help. Help them calculate the maximum value of f among all possible values of l and r for the given array a.

Input

The first line contains single integer n (2 ≤ n ≤ 105) — the size of the array a.

The second line contains n integers a1, a2, ..., an (-109 ≤ ai ≤ 109) — the array elements.

Output

Print the only integer — the maximum value of f.

Examples

Input

5
1 4 2 3 1


Output

3

Input

4
1 5 4 7


Output

6

Note

In the first sample case, the optimal value of f is reached on intervals [1, 2] and [2, 5].

In the second case maximal value of f is reachable only on the whole array.
import java.io.*;
import java.math.*;
import java.security.KeyStore.Entry;
import java.util.*;

public class TestClass {
	private static InputStream stream;
	private static byte[] buf = new byte[1024];
	private static int curChar;
	private static int numChars;
	private static SpaceCharFilter filter;
	private static PrintWriter pw;
	
	static class ST{
		long arr[] = new long[1000000];
		long lazy[] = new long[1000000];
		public void insert(int l,int r,int c,int x,int y,long val){
			if(lazy[c]!=0){
				lazy[2*c+1]+=lazy[c];
				lazy[2*c+2]+=lazy[c];
				arr[c]+=lazy[c];
				lazy[c] = 0;
			}
			if(l>r||x>y||l>y||x>r)
				return ;
			if(x<=l&&y>=r){
				lazy[2*c+1]+=val;
				lazy[2*c+2]+=val;
				arr[c]+=val;
				return ;
			}
			int mid = (l+r)>>1;
			insert(l,mid,2*c+1,x,y,val);
			insert(mid+1,r,2*c+2,x,y,val);
			arr[c] = Math.max(arr[2*c+1], arr[2*c+2]);
		}
		public long ans(int l,int r,int c,int x,int y){
			if(lazy[c]!=0){
				lazy[2*c+1]+=lazy[c];
				lazy[2*c+2]+=lazy[c];
				arr[c]+=(r-l+1)*lazy[c];
				lazy[c] = 0;
			}
			if(l>r||x>y||l>y||x>r)
				return 0;
			if(x<=l&&y>=r)
				return arr[c];
			int mid = (l+r)>>1;
			return Math.max(ans(l,mid,2*c+1,x,y), ans(mid+1,r,2*c+2,x,y));
		}
	}
	private static void soln() {
		/*long b = nI(),q = nI(),l = nI(),m = nI();
		HashSet<Long> set = new HashSet<Long>();
		while(m-->0)
			set.add(nL());
		if(Math.abs(b)>l){
			pw.println("0");
			return ;
		}
		else if(b==0||q==0){
			if(!set.contains((long)0))
				pw.println("inf");
			else if(set.contains(b))
				pw.println("0");
			else if(!set.contains(b))
				pw.println("1");
			else
				pw.println("inf");
		}
		else if(q==1||q==-1){
			if((q==1&&set.contains(b))||(q==-1&&set.contains(b)&&set.contains(b*-1)))
				pw.println("0");
			else
				pw.println("inf");
		}
		else{
			long ans = 0;
			while(Math.abs(b)<=l){
				if(!set.contains(b))
					ans++;
				b*=q;
			}
			pw.println(ans);
		}*/
		int n = nI();
		long arr[] = new long[n];
		for(int i=0;i<n;i++)
			arr[i] = nL();
		long a[] = new long[n-1];
		for(int i=1;i<n;i++)
			a[i-1] = Math.abs(arr[i]-arr[i-1]);
		long ans = 0;
		ST b[] = new ST[2];
		for(int i=0;i<2;i++)
			b[i] = new ST();
		b[0].insert(0, n-2, 0, 0, 0, a[0]);
		b[1].insert(0, n-2, 0, 0, 0, -1*a[0]);
		ans = a[0];
		for(int i=1;i<n-1;i++){
			ans = Math.max(a[i], ans);
			if((i&1)==1){
				b[0].insert(0, n-2, 0, 0, i, -1*a[i]);
				long tem = b[1].ans(0, n-2, 0, 0, i-1);
				ans = Math.max(ans, tem+a[i]);
				b[1].insert(0, n-2, 0, 0, i, a[i]);
				//pw.println(tem+" "+i);
			}
			else{
				long tem = b[0].ans(0, n-2, 0, 0, i-1);
				//pw.println(tem+" "+i);
				ans = Math.max(ans, tem+a[i]);
				b[0].insert(0, n-2, 0, 0, i, a[i]);
				b[1].insert(0, n-2, 0, 0, i, -1*a[i]);
			}
		}
		pw.println(ans);
	}

	public static void main(String[] args) {
		InputReader(System.in);
		pw = new PrintWriter(System.out);
		soln();
		pw.close();
	}

	// To Get Input
	// Some Buffer Methods
	public static void InputReader(InputStream stream1) {
		stream = stream1;
	}

	private static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private static boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

	private static int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	private static int nI() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static long nL() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private static String nLi() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	private static boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}