Contest 8 May

Start

2018-05-07 17:00 AKDT

Contest 8 May

End

2018-05-07 22:00 AKDT
The end is near!
Contest is over.
Not yet started.
Contest is starting in -829 days 1:24:53

5:00:00

0:00:00

Problem GSumsets

Given $S$, a set of integers, find the largest $d$ such that $a + b + c = d$ where $a, b, c$ and $d$ are distinct elements of $S$.

Input

The input starts with an integer $1 \le N \le 4\, 000$, the number of elements in $S$. It is followed by $N$ lines containing the elements of $s$, one per line. Each element of $S$ is a distinct integer between $-536\, 870\, 912$ and $+536\, 870\, 911$, inclusive.

Output

Output a single line containing the maximum $d$ as described in the statement. If no such $d$ exists, output a single line containing no solution.

Sample Input 1 Sample Output 1
5
2
3
5
7
12

12

Sample Input 2 Sample Output 2
5
2
16
64
256
1024

no solution