CSES - Aalto Competitive Programming 2024 - wk8 - Homework C++ - Counting ones
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are given a list of nn integers, a1,a2,,ana_1, a_2, \dots, a_n. Your task is to pick two numbers aia_i and aja_j (1i<jn1 \leq i < j \leq n) from the list such that the product aiaja_i \cdot a_j has the maximum number of 1 bits in its binary representation.

Input

The first line contains a single integer nn, the size of the list. The second line contains nn integers a1,a2,,ana_1, a_2, \dots, a_n, the elements of the list.

Output

On the first line, print a single integer: the maximum number of 1 bits in the product.

On the second line, print two integers, the values aia_i and aja_j, such that their product has the maximum number of 1 bits in its binary representation. If there are multiple valid answers, print any of them.

Constraints

  • 2n1042 \leq n \leq 10^4
  • 1ai1091 \leq a_i \leq 10^9

Example

Input:

5
2 3 7 10 15

Output:

4
3 15