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.

/**
 * Created by Sourav Kumar Paul on 3/30/2017.
 */

import java.io.*;
import java.util.*;

public class SolveA {

    public static Reader in;
    public static PrintWriter out;
    public static long mod = 1000000007;
    public static long inf = 100000000000000000l;
    public static long fac[], inv[];
    public static int union[];

    public static void solve() {
        int n = in.nextInt();
        long arr[] = new long[n];
        for(int i=0; i<n; i++)
        {
            arr[i] = in.nextLong();

        }
        ArrayList<Long> list = new ArrayList<>();
        for(int i=0; i<n-1; i++)
        {
            if(i%2==0)
            {
                list.add(Math.abs(arr[i]-arr[i+1]));

            }
            else
                list.add(-1*Math.abs(arr[i]-arr[i+1]));
        }
        long ans= kedane(list);
        list = new ArrayList<>();
        for(int i=0; i<n-1; i++)
        {
            if(i%2==0)
                list.add(-1*Math.abs(arr[i] - arr[i+1]));
            else
                list.add(Math.abs(arr[i]-arr[i+1]));
        }
        ans = Math.max(ans,kedane(list));
        out.println(ans);
    }

    private static long kedane(ArrayList<Long> list) {
        long ans = 0,max=0;
        for(long v:list)
        {
            if(v+ans < 0)
                ans =0;
            else
                ans = v+ans;
            max = Math.max(ans,max);
        }
        return max;
    }


    public static class Pair implements Comparable {
        int x, y;

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

        @Override
        public int compareTo(Object o) {
            Pair pp = (Pair) o;
            if (pp.x == x)
                return 0;
            else if (x > pp.x)
                return 1;
            else
                return -1;
        }
    }


    public static void init() {
        for (int i = 0; i < union.length; i++)
            union[i] = i;
    }

    public static int find(int n) {
        return (union[n] == n) ? n : (union[n] = find(union[n]));
    }

    public static void unionSet(int i, int j) {
        union[find(i)] = find(j);
    }

    public static boolean connected(int i, int j) {
        return union[i] == union[j];
    }

    public static long gcd(long a, long b) {
        long x = Math.min(a, b);
        long y = Math.max(a, b);
        while (x != 0) {
            long temp = x;
            x = y % x;
            y = temp;
        }
        return y;
    }

    public static long modPow(long base, long exp, long mod) {
        base = base % mod;
        long result = 1;
        while (exp > 0) {
            if (exp % 2 == 1) {
                result = (result * base) % mod;
                exp--;
            } else {
                base = (base * base) % mod;
                exp = exp >> 1;
            }

        }
        return result;
    }

    public static void cal() {
        fac = new long[1000005];
        inv = new long[1000005];
        fac[0] = 1;
        inv[0] = 1;
        for (int i = 1; i <= 1000000; i++) {
            fac[i] = (fac[i - 1] * i) % mod;
            inv[i] = (inv[i - 1] * modPow(i, mod - 2, mod)) % mod;
        }
    }

    public static long ncr(int n, int r) {
        return (((fac[n] * inv[r]) % mod) * inv[n - r]) % mod;
    }


    SolveA() throws IOException {
        in = new Reader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        out.flush();
        out.close();
    }

    public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try {
                    new SolveA();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
    }

    public static class Reader {
        public BufferedReader reader;
        public StringTokenizer st;

        public Reader(InputStreamReader stream) {
            reader = new BufferedReader(stream);
            st = null;
        }

        public Reader(FileReader stream) {
            reader = new BufferedReader(stream);
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() throws IOException {
            return reader.readLine();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }
}

