#C4392. Finding the Pair with the Smallest Difference

    ID: 47925 Type: Default 1000ms 256MiB

Finding the Pair with the Smallest Difference

Finding the Pair with the Smallest Difference

You are given an array of n integers. Your task is to find the pair of elements with the smallest absolute difference \(|a - b|\) and output the two numbers in non-decreasing order.

Input Format: The first line contains an integer n denoting the number of elements in the array. The second line contains n space-separated integers.

Output Format: Output two integers, which form the pair having the smallest absolute difference. If there are multiple pairs with the same minimum absolute difference, you may output any one of them.

Note: The absolute difference is defined as \(|a - b|\), where \(a\) and \(b\) are two elements of the array.

inputFormat

The first line contains an integer n — the number of elements. The second line contains n space-separated integers.

outputFormat

Print two space-separated integers that are the pair with the smallest absolute difference in non-decreasing order.

## sample
5
4 9 1 12 8
8 9

</p>