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.util.*;

public class ProblemC {

	static class OutputWriter {
	private final PrintWriter writer;
	
	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}
	
	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}
	
	public void print(Object...objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}
	
	public void printLine(Object...objects) {
		print(objects);
		writer.println();
	}
	
	public void close() {
		writer.close();
	}
	
	public void flush() {
		writer.flush();
	}
	
	}

	static class Reader
	{
	    final private int BUFFER_SIZE = 1 << 16;
	    private DataInputStream din;
	    private byte[] buffer;
	    private int bufferPointer, bytesRead;
	
	    public Reader()
	    {
	        din = new DataInputStream(System.in);
	        buffer = new byte[BUFFER_SIZE];
	        bufferPointer = bytesRead = 0;
	    }
	
	    public Reader(String file_name) throws IOException
	    {
	        din = new DataInputStream(new FileInputStream(file_name));
	        buffer = new byte[BUFFER_SIZE];
	        bufferPointer = bytesRead = 0;
	    }
	
	    public String readLine() throws IOException
	    {
	        byte[] buf = new byte[50000]; // line length
	        int cnt = 0, c;
	        while ((c = read()) != -1)
	        {
	            if (c == '\n')
	                break;
	            buf[cnt++] = (byte) c;
	        }
	        return new String(buf, 0, cnt);
	    }
	
	    public int nextInt() throws IOException
	    {
	        int ret = 0;
	        byte c = read();
	        while (c <= ' ')
	            c = read();
	        boolean neg = (c == '-');
	        if (neg)
	            c = read();
	        do
	        {
	            ret = ret * 10 + c - '0';
	        }  while ((c = read()) >= '0' && c <= '9');
	
	        if (neg)
	            return -ret;
	        return ret;
	    }
	
	    public long nextLong() throws IOException
	    {
	        long ret = 0;
	        byte c = read();
	        while (c <= ' ')
	            c = read();
	        boolean neg = (c == '-');
	        if (neg)
	            c = read();
	        do {
	            ret = ret * 10 + c - '0';
	        }
	        while ((c = read()) >= '0' && c <= '9');
	        if (neg)
	            return -ret;
	        return ret;
	    }
	
	    public double nextDouble() throws IOException
	    {
	        double ret = 0, div = 1;
	        byte c = read();
	        while (c <= ' ')
	            c = read();
	        boolean neg = (c == '-');
	        if (neg)
	            c = read();
	
	        do {
	            ret = ret * 10 + c - '0';
	        }
	        while ((c = read()) >= '0' && c <= '9');
	
	        if (c == '.')
	        {
	            while ((c = read()) >= '0' && c <= '9')
	            {
	                ret += (c - '0') / (div *= 10);
	            }
	        }
	
	        if (neg)
	            return -ret;
	        return ret;
	    }
	
	    private void fillBuffer() throws IOException
	    {
	        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
	        if (bytesRead == -1)
	            buffer[0] = -1;
	    }
	
	    private byte read() throws IOException
	    {
	        if (bufferPointer == bytesRead)
	            fillBuffer();
	        return buffer[bufferPointer++];
	    }
	
	    public void close() throws IOException
	    {
	        if (din == null)
	            return;
	        din.close();
	    }
	}
	public static long maxSubarray(long[] a){
	    long max_so_far = Long.MIN_VALUE;
	    long max_ending_here = 0;
	    for(int i=0;i<a.length;i++){
	    	max_ending_here+=a[i];
	    	if(max_ending_here<0){
	    		max_ending_here=0;
	    	}
	    	if(max_so_far<max_ending_here){
	    		max_so_far=max_ending_here;
	    	}
	    }
	    return max_so_far;
	}
	public static void print(long[]a){
		for(int i=0;i<a.length;i++){
			System.out.print(a[i]+" ");
		}
		System.out.println("");
	}
	public static void main(String[] args)throws IOException{
		Reader in =new Reader();
		OutputWriter out=new OutputWriter(System.out);
		int n=in.nextInt();
		long[] a=new long[n];
		long[] b=new long[n-1];
		long[] c=new long[n-1];
		for(int i=0;i<n;i++){
			a[i]=in.nextLong();
		}
		for(int i=0;i<n-1;i++){
			if(i%2==0){
				b[i]=Math.abs(a[i]-a[i+1]);
				c[i]=-b[i];
			}
			else{
				c[i]=Math.abs(a[i+1]-a[i]);
				b[i]=-c[i];
			}
		}
	//	print(b);
	//	print(c);
		
		out.printLine(Math.max(maxSubarray(b), maxSubarray(c)));
		out.flush();
	}
}
