Problem: After playing with her beautiful array, Mishka decided to learn some math. After learning how to multiply, divide and what is divisibility, she is now interested in solving the following problem.

You are given integer k and array a1, a2, ..., an of n integers. You are to find non-empty subsequence of array elements such that the product of its elements is divisible by k and it contains minimum possible number of elements.

Formally, you are to find a sequence of indices 1 ≤ i1 < i2 < ... < im ≤ n such that <image> is divisible by k while m is minimum possible among all such variants.

If there are more than one such subsequences, you should choose one among them, such that sum of its elements is minimum possible.

Mishka quickly solved this problem. Will you do so?

Input

The first line of the input contains two integers n and k (1 ≤ n ≤ 1 000, 1 ≤ k ≤ 1012).

The second line of the input contains n integers a1, a2, ..., an (1 ≤ ai ≤ 1012) — array elements.

Output

Print single positive integer m in the first line — the number of elements in desired sequence.

In the second line print m distinct integers — the sequence of indices of given array elements, which should be taken into the desired sequence. 

If there are more than one such subsequence (e.g. subsequence of minimum possible number of elements and with minimum possible sum of elements), you can print any of them.

If there are no such subsequences, print  - 1 in the only line.

Example

Input

5 60
2 4 6 5 2


Output

3
4 3 1 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int numPF(long long x);
void get_factor(int i, long long x);
int sieve();
int bin_search(long long x);
pair<int, long long> min(pair<int, long long> x, pair<int, long long> y);
pair<int, long long> fn(int i, long long x);
long long gcd(long long a, long long b);
void traverse(int i, long long x);
void tabular();
bool v[1000009 + 5];
long long primes[1000009];
int n_primes;
pair<long long, int> arr_pf[100];
int n, n_f = 0, n_pf = 0;
long long arr[1000009], arr_f[1000009], k, arr2[1000009];
int p[1000009];
pair<int, long long> dp[1005][10009];
bool vis[1005][10009];
int main() {
  scanf("%d %lld", &n, &k);
  for (int i = 0; i < n; i++) scanf("%lld", &arr2[i]);
  n_primes = sieve();
  n_pf = numPF(k);
  get_factor(0, 1);
  arr_f[n_f++] = 1;
  sort(arr_f, arr_f + n_f);
  if (k == 1) {
    long long s = (1LL << 63) - 1;
    int indx = 0;
    for (int i = 0; i < n; i++)
      if (arr2[i] < s) indx = i, s = arr2[i];
    printf("1\n%d\n\n", indx + 1);
    return 0;
  }
  int j = 0;
  for (int i = 0; i < n; i++)
    if (gcd(k, arr2[i]) > 1) arr[j] = arr2[i], p[j++] = i;
  ;
  n = j;
  tabular();
  pair<int, long long> ans = dp[0][n_f - 1];
  if (ans.first == (1 << 30) - 1) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", ans.first);
  traverse(0, k);
  printf("\n");
  return 0;
}
void tabular() {
  for (int i = n; i >= 0; i--)
    for (int y = 0; y < n_f; y++) {
      vis[i][y] = 1;
      long long x = arr_f[y];
      pair<int, long long> ret;
      ret.first = (1 << 30) - 1, ret.second = (1LL << 62) - 1;
      if (i == n) {
        if (x == 1) ret.first = 0, ret.second = 0;
      } else if (x == 1)
        ret.first = 0, ret.second = 0;
      else {
        pair<int, long long> tmp;
        long long g = gcd(x, arr[i]);
        if (g > 1) {
          int t = bin_search(x / g);
          tmp = dp[i + 1][t];
          tmp.first += 1, tmp.second += arr[i];
          ret = min(ret, tmp);
        }
        tmp = dp[i + 1][y];
        ret = min(ret, tmp);
      }
      dp[i][y] = ret;
    }
}
void traverse(int i, long long x) {
  if (i == n || x == 1) return;
  int y = bin_search(x);
  pair<int, long long> ret = dp[i][y];
  pair<int, long long> tmp = fn(i + 1, x / gcd(x, arr[i]));
  tmp.first += 1, tmp.second += arr[i];
  if (tmp.first == ret.first && ret.second == tmp.second) {
    printf("%d ", p[i] + 1);
    traverse(i + 1, x / gcd(x, arr[i]));
    return;
  }
  tmp = fn(i + 1, x);
  if (tmp.first == ret.first && ret.second == tmp.second) {
    traverse(i + 1, x);
    return;
  }
}
pair<int, long long> fn(int i, long long x) {
  if (x == 1) {
    pair<int, long long> ret;
    ret.first = 0, ret.second = 0;
    return ret;
  }
  if (i == n) {
    pair<int, long long> ret;
    ret.first = (1 << 30) - 1, ret.second = (1LL << 62) - 1;
    return ret;
  }
  int y = bin_search(x);
  pair<int, long long> &ret = dp[i][y];
  bool &flag = vis[i][y];
  if (flag) return ret;
  flag = 0;
  ret.first = (1 << 31) - 1, ret.second = (1LL << 63) - 1;
  pair<int, long long> tmp;
  tmp = fn(i + 1, x / gcd(x, arr[i]));
  tmp.first += 1, tmp.second += arr[i];
  ret = min(ret, tmp);
  tmp = fn(i + 1, x);
  ret = min(ret, tmp);
  return ret;
}
pair<int, long long> min(pair<int, long long> x, pair<int, long long> y) {
  if (x.first == y.first) {
    if (x.second < y.second) return x;
    return y;
  }
  if (x.first < y.first) return x;
  return y;
}
int bin_search(long long x) {
  int s = 0, b = n_f - 1;
  while (b >= s) {
    int mid = (b + s) / 2;
    if (arr_f[mid] == x) return mid;
    if (arr_f[mid] > x)
      b = mid - 1;
    else
      s = mid + 1;
  }
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void get_factor(int i, long long x) {
  if (i == n_pf) {
    if (x > 1) arr_f[n_f++] = x;
    return;
  }
  get_factor(i + 1, x);
  for (int j = 1; j <= arr_pf[i].second; j++)
    get_factor(i + 1, x * arr_pf[i].first), x = x * arr_pf[i].first;
}
int sieve() {
  memset(v, 0, sizeof(v));
  v[0] = v[1] = 1;
  long long i, j;
  for (i = 2; i * i < 1000009; i++) {
    if (!v[i]) {
      for (j = i * i; j < 1000009; j += i) {
        v[j] = 1;
      }
    }
  }
  int index = 0;
  for (i = 2; i < 1000009; i++) {
    if (!v[i]) {
      primes[index++] = i;
    }
  }
  return index;
}
int numPF(long long x) {
  int i = 0, ret = 0;
  long long pf = primes[i++];
  while (x != 1 && i < n_primes && x >= pf * pf) {
    int cnt = 0;
    while (x % pf == 0) {
      x /= pf;
      cnt++;
    }
    if (cnt) arr_pf[ret].first = pf, arr_pf[ret++].second = cnt;
    pf = primes[i++];
  }
  if (x != 1) arr_pf[ret].first = x, arr_pf[ret++].second = 1;
  return ret;
}