Skyline
Shahid has been tasked with designing two new skyscrapers to place on the Adelaide skyline! However, his employer already has a few designs in mind for him to pick from. Shahid knows that picking two buildings with the smallest height difference will have the best result, but he is too busy to look through all the designs himself. Your job is to look through the list of buildings, and find the two closest together in size.
Input
$N$ ($0 \leq N \leq 10^3$) - the number of buildings Shahid has to consider $H_1 \dots H_N$ ( $0 \leq H_i \leq 10^9$) - $H_i$ is the height of the $i$th building
Output
Output two integers $H_a\ H_b$ - the heights of the buildings closest together in height, with the smaller first. It is guaranteed that there will be only one solution.
Example
Input 1
4
1 9 3 10
Output 1
9 10
Comments