#C1403. Find the Pair with the Smallest Absolute Difference

    ID: 43634 Type: Default 1000ms 256MiB

Find the Pair with the Smallest Absolute Difference

Find the Pair with the Smallest Absolute Difference

Given a list of integers, your task is to find the pair of numbers that have the smallest absolute difference between them. More formally, for a set of integers \(\{a_1, a_2, \dots, a_n\}\), you need to select two numbers \(a_i\) and \(a_j\) such that the value \(\left|a_i - a_j\right|\) is minimized.

If there are multiple pairs with the same smallest difference, return the pair that appears first after sorting the list in non-decreasing order. The input is provided via standard input (stdin) and the output should be printed via standard output (stdout).

inputFormat

The first line of input contains an integer \(n\) representing the number of elements in the list. The second line contains \(n\) space-separated integers.

outputFormat

Output two integers separated by a single space. These integers constitute the pair with the smallest absolute difference.

## sample
6
3 8 15 17 9 50
8 9