Wealth and Magic
Mandrake, the Magician, has decided to distribute his wealth among his best friends, Lothar and Magnon. Now he has N coins each having some value A[i] (1 <= i <= N). Being a great magician, Mandrake can change the value of all the coins except the first and the last one. He can change the value of ith coin to half of sum of value of (i-1)th and (i+1)th coin but for doing so, two condition needs to be fulfilled:
(1) value of both (i-1)th and (i+1)th coin should be even and
(2) if jth coin's value is changed after ith coin's value then j should be greater than i.
Now, he will distribute his wealth such that he will give one coin from the back to Lothar and one coin from the front to Magnon simultaneously. He will continue this until all the coins he owns are distributed. Consider that in case of odd number of coins he will give his middle most coin to another friend, Theron. Now he wishes to maximize the absolute difference of value of coins given to Lothar and Magnon through his magic. His magic is weak now, so, he asks your help to tell him the maximum difference.
Input
* The first line contains N
* The second line contains N integers representing value of each coin.
Output
* Maximum absolute difference.
Constraints
* 1<=N<=20
* 1<=Value of each coin<=10^4
Sample Input
10
5 6 5 2 1 7 9 7 2 5
Sample Output
20