Start

2018-05-08 01:00 UTC

Contest 8 May

End

2018-05-08 06:00 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -502 days 13:29:47

Time elapsed

5:00:00

Time remaining

0:00:00

Problem G
Sumsets

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