Start

2019-01-28 13:00 UTC

Kattis Set 03

End

2019-02-04 09:29 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -288 days 22:53:50

Time elapsed

164:29:59

Time remaining

0:00:00

Problem J
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