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.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
import java.util.*;
 
public class main {
 
	
	static ArrayList<Integer> prime;
	static boolean check[];
    static ArrayList<Integer> queue;
    public static void main(String[] args) {    
        InputReader sc=new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int t=1;
        while(t-->0){
        	int n=sc.nextInt();
        	long a[]=sc.nextIntArray(n);
        	long sum[]=new long[n-1];
        	for(int i=0;i<n-1;i++){
        		sum[i]=Math.abs(a[i]-a[i+1]);
        	}
        	long ans=Integer.MIN_VALUE;
        	int start=0;
        	long temp=0;
        	for(int i=0;i<n-1;i++){
        		if(i%2==0)
        			temp=temp+sum[i];
        		else
        			temp=temp-sum[i];
        		if(temp>ans)
        			ans=temp;
        		if(temp<0){
        			start=start+2;	
        			temp=0;
        		}
        	}
        	temp=0;
        	start=1;
        	for(int i=1;i<n-1;i++){
        		if(i%2==1)
        			temp=temp+sum[i];
        		else
        			temp=temp-sum[i];
        		if(temp>ans)
        			ans=temp;
        		if(temp<0){
        			start=start+2;	
        			temp=0;
        		}
        	}
        	System.out.println(ans);
        }
        pw.close();
    }
    
    static int maxSubArraySum(int a[])
    {
        int size = a.length;
        int max_so_far = Integer.MIN_VALUE, max_ending_here = 0;

        for (int i = 0; i < size; i++)
        {
            max_ending_here = max_ending_here + a[i];
            if (max_so_far < max_ending_here)
                max_so_far = max_ending_here;
            if (max_ending_here < 0)
                max_ending_here = 0;
        }
        return max_so_far;
    }
    
    
    static int gcd(int n1,int n2){
    	int r;
    	while(n2 != 0)
        {
            r = n1 % n2;
            n1 = n2;
            n2 = r;
        }
    	return n1;
    }
    private static void printMatrixInSpiralWay(int[][] matrix){
    	 
    	  int rowStart=0;
    	  int rowLength=matrix.length-1;
    	   
    	  int colStart=0;
    	  int colLength = matrix[0].length-1;
    	   
    	  while(rowStart <= rowLength && colStart <= colLength){
    	   
    	   for (int i = rowStart; i <= colLength; i++) {
    	    System.out.print(matrix[rowStart][i] + " ");
    	   }
    	 
    	   for (int j = rowStart+1; j <= rowLength; j++) {
    	    System.out.print(matrix[j][colLength] + " ");
    	   }
    	    
    	   if(rowStart+1 <= rowLength){
    	    for (int k = colLength-1; k >= colStart; k--) {
    	     System.out.print(matrix[rowLength][k] + " ");
    	    }
    	   }
    	   if(colStart+1 <= colLength){
    	    for (int k = rowLength-1; k > rowStart; k--) {
    	     System.out.print(matrix[k][colStart] + " ");
    	    }
    	   }
    	    
    	   rowStart++;
    	   rowLength--;
    	   colStart++;
    	   colLength--;
    	  }
    	 }
    
    
    public static long fact(int n){
    	long ans=1;
    	for(long i=2;i<=n;i++){
    		ans=(ans*i)%1000000007;
    	}
    	return ans;
    }
    
    public static int pop(){
    	int x=queue.get(0);
    	queue.remove(0);
    	return x;
    }
    
    public static int[][] sort2D(int arr[][]){
		Arrays.sort(arr, new Comparator<int[]>()
		{
		     public int compare(int[] o1, int[] o2)
		     {
		    	 return(Integer.compare(o2[0],o1[0]));
		     }
		});
		return arr;
	}
    
 
    
    public class Pair {

        private final int x;
        private final int y;

        public Pair(final int x, final int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(final Object o) {
            if (this == o) {
                return true;
            }
            if (!(o instanceof Pair)) {
                return false;
            }

            final Pair pair = (Pair) o;

            if (x != pair.x) {
                return false;
            }
            if (y != pair.y) {
                return false;
            }

            return true;
        }

        @Override
        public int hashCode() {
            int result = x;
            result = 31 * result + y;
            return result;
        }
    } 
    
    static class InputReader {
 
    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;
 
    public InputReader(InputStream stream) {
        this.stream = stream;
    }
 
    public int snext() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }
 
    public int nextInt() {
        int c = snext();
        while (isSpaceChar(c)) {
            c = snext();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = snext();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = snext();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public long nextLong() {
        int c = snext();
        while (isSpaceChar(c)) {
            c = snext();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = snext();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = snext();
        } while (!isSpaceChar(c));
        return res * sgn;
    }
 
    public long[] nextIntArray(int n) {
        long a[] = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = (long)nextInt();
        }
        return a;
    }
 
    public String readString() {
        int c = snext();
        while (isSpaceChar(c)) {
            c = snext();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = snext();
        } while (!isSpaceChar(c));
        return res.toString();
    }
 
    public String nextLine() {
        int c = snext();
        while (isSpaceChar(c))
            c = snext();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = snext();
        } while (!isEndOfLine(c));
        return res.toString();
    }
 
    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }
 
    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }
 
    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}
}