Product of numbers#5440

Product of numbers

1 second
122.486 megabytes
Easy

Given integers A_1, A_2, , A_n and number .

Choose such subset of numbers A_1, A_2, , A_n so that their product taken modulo is maximum.

Input

First line contains two integers and ( , ). Second line contains integers A_1, A_2, , A_n ( A_i ).

Output

Print in the first line numbers and - the product of chosen numbers by modulo and the number of chosen numbers. Print in the second line numbers B_1, B_2, , B_k - the indexes of chosen numbers. The indexes must be pairwise different. If there are multiple answers with maximum , print any of them.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading