Triangle

아직 제출이 없습니다시간 제한3초메모리 제한512 MB

문제

There are NN sticks. The length of the ii-th stick is a_ia\_i. You want to choose six sticks and construct two triangles. Each stick should be used as an edge of one of the triangles. Also, the triangles should be non-degenerate.

Compute the maximum possible total length of the six chosen sticks. If two triangles can not be constructed this way, assume the total length is 0.

입력

The first line contains an integer NN (1N1051 \le N \le 10^5). The ii-th of the next NN lines contains an integer a_ia\_i (1a_i10151 \le a\_i \le 10^{15}).

출력

Print the answer.