- Time limit: 1.00 s
- Memory limit: 512 MB
You are given an array of distinct integers. Your task is to select three of them such that their sum is maximal.
Input
The input consists of two lines. The first line has a single integer, , the size of the array. The second line has exactly integers separated by spaces denoting the array.
Output
Output a single line containing the elements of the array that produce the maximal output. You may print the numbers in any order.
Constraints
- All elements in the array are in the range
Example
Input:
9 7 11 3 31 25 10 50 38 17
Output:
50 31 38