cho.sh
Notes
Loading...

Two Liquids

Time limit

1s

Memory limit

128 MB

Problem

A science laboratory has many acidic and alkaline liquids. Each liquid is represented by one integer property value. Acidic liquids have positive property values from 1 to 1,000,000,000, and alkaline liquids have negative property values from -1 to -1,000,000,000.

When two distinct liquids are mixed in equal amounts, the property value of the new liquid is the sum of the two chosen values. The goal is to choose two liquids whose mixed value is as close to 0 as possible.

For example, if the property values are [-2, 4, -99, -1, 98], mixing the liquids with values -99 and 98 gives a mixed value of -1, which is closest to 0. The best pair may also consist of two acidic liquids or two alkaline liquids.

Given the property values of the liquids, find two distinct liquids whose sum is closest to 0.

Input

The first line contains the number of liquids N. N is between 2 and 100,000, inclusive.

The second line contains N integers separated by spaces, the property values of the liquids. Every value is between -1,000,000,000 and 1,000,000,000, inclusive, and all values are distinct. The input may contain only acidic liquids or only alkaline liquids.

Output

Print the property values of the two liquids whose sum is closest to 0, in increasing order.

If more than one pair is closest to 0, print any one of them.