Min Xor Pairs

easy
1. You are given an array of distinct integers.
2. You have to print all pairs of integers in the array whose XOR value is minimum.

Input Format

A number N arr1 arr2.. N numbers

Output Format

Check the sample output and question video.

Constraints

1 <= n <= 10^5
-10^9 <= arr[i] <= 10^9

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
4
2
0
5
7
Output
0, 2
5, 7
Previous
N Queens Using Bit
Next
Nth Palindromic Binary

Related Questions