Problem2437--abc272c - Max Even

2437: abc272c - Max Even

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Problem Statement

You are given a sequence A=(A_1,A_2,\ldots,A_N)A=(A1,A2,,AN) of length NN consisting of non-negative integers.
Determine if there is an even number represented as the sum of two different elements of AA. If it exists, find the maximum such number.

Constraints

  • 2\leq N \leq 2\times 10^52N2×105
  • 0\leq A_i\leq 10^90Ai109
  • The elements of AA are distinct.
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:
NNA_1A1A_2A2\ldotsA_NAN

Output

Print -1 if there is no even number represented as the sum of two different elements of AA.
If such an even number exists, print the maximum such number.

Sample Input Copy

3
2 3 4

Sample Output Copy

6

HINT

The values represented as the sum of two distinct elements of AA are 5566, and 77. We have an even number here, and the maximum is 66.

Source/Category