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.awt.List;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;

public class Tester
{
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	void solve()
	{
		int n=ni();
		int[] a=na(n);
		long[] a1=new long[n-1];
		long[] a2=new long[n-1];
		
		for(int i=0;i<n-1;i++) {
			if(i%2==0) {
				a1[i]=-Math.abs(a[i+1]-a[i]);
				a2[i]=Math.abs(a[i+1]-a[i]);
			}
			else {
					a1[i]=Math.abs(a[i+1]-a[i]);
					a2[i]=-Math.abs(a[i+1]-a[i]);
			}
		}
		out.println(Math.max(findMaxSubArray(a1),findMaxSubArray(a2)));
	}
	

	long findMaxSubArray(long[] inputArray){                                     //for findMinSubArray replace intArray[i] with 
	        int maxStartIndex=0;                                                                // (-1)*intArray[i]
	        int maxEndIndex=0;                                                                  //  And Special case for all input positive
	       long maxSum = 0;


	       long cumulativeSum= 0;
	        int maxStartIndexUntilNow=0;

	        for (int currentIndex = 0; currentIndex < inputArray.length; currentIndex++) {

	           long eachArrayItem = inputArray[currentIndex];

	            cumulativeSum+=eachArrayItem;

	            if(cumulativeSum>=maxSum){
	                maxSum = cumulativeSum;
	                maxStartIndex=maxStartIndexUntilNow;
	                maxEndIndex = currentIndex;
	            }
	            else if (cumulativeSum<0){
	                maxStartIndexUntilNow=currentIndex+1;
	                cumulativeSum=0;
	            }
	        }

	        // +++++for all numbers are negative+++++
	        int flag = 0;                                                          
	        int maxindex =0;
	        for(int i=0;i<inputArray.length;i++){
	            if(inputArray[i]>0){                                               
	                flag = 1;
	            }
	            if(inputArray[maxindex]<inputArray[i]){
	                maxindex = i;
	            }
	        }
	        if(flag==0){
	            maxSum = inputArray[maxindex];
	            maxStartIndex = maxindex;
	            maxEndIndex = maxindex;
	        }
	        //+++++____________________________+++++
	        return maxSum;

	    }
	
			
	void run() throws Exception
	{
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
	}
	
	public static void main(String[] args) throws Exception 
	{ new Tester().run(); }
	
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try 
			{ lenbuf = is.read(inbuf); } 
			catch (IOException e) 
			{ throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c)
	{ return !(c >= 33 && c <= 126); }
	private int skip() 
	{ int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() 
	{ return Double.parseDouble(ns()); }
	private char nc()
	{ return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b)))
		{ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b)))
		{
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	
	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-')
		{
			minus = true;
			b = readByte();
		}
		
		while(true)
		{
			if(b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-')
		{
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private static void tr(Object... o) 
	{ System.out.println(Arrays.deepToString(o)); }
}
