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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;
 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jialin Ouyang (Jialin.Ouyang@gmail.com)
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    QuickScanner in = new QuickScanner(inputStream);
    QuickWriter out = new QuickWriter(outputStream);
    TaskE solver = new TaskE();
    solver.solve(1, in, out);
    out.close();
  }
 
  static class TaskE {
    private static final int MAX_PRIME_FACTOR = 30;
    private static final int MAX_EXP = 50;
    private static final int MAX_DIVISORS = 10000;
    int n;
    long k;
    int pCnt;
    long[] pk;
    int[] rk;
    int divisorCnt;
    long[] divisors;
    long[] a;
    int[][] aJump;
    int[][] minCnt;
    long[][] minSum;
    int[][] fromSum;
 
    public void solve(int testNumber, QuickScanner in, QuickWriter out) {
      n = in.nextInt();
      k = in.nextLong();
      a = new long[n];
      in.nextLong(n, a);
 
      if (k == 1) {
        out.println('1');
        long minA = LongArrayUtils.min(a);
        for (int i = 0; i < n; ++i)
          if (minA == a[i]) {
            out.println(i + 1);
            return;
          }
      }
 
      pk = new long[MAX_PRIME_FACTOR];
      rk = new int[MAX_PRIME_FACTOR];
      pCnt = LongUtils.factorize(k, pk, rk);
      divisors = new long[MAX_DIVISORS];
      divisorCnt = LongUtils.divisors(k, divisors);
 
      calcJump();
      calc();
      if (minSum[n][0] == Long.MAX_VALUE) {
        out.println("-1");
      } else {
        IntArrayList lst = new IntArrayList(n);
        int j = 0;
        for (int i = n; i > 0; --i) {
          if (fromSum[i][j] != j) {
            j = fromSum[i][j];
            lst.add(i);
          }
        }
        out.println(lst.size());
        for (int i = 0; i < lst.size(); ++i) {
          out.print(lst.get(i));
          out.print(i + 1 == lst.size() ? '\n' : ' ');
        }
      }
    }
 
    void calcJump() {
      int[][] divisorJump = new int[divisorCnt][MAX_EXP];
      int[] expCnt = new int[divisorCnt];
      aJump = new int[n][divisorCnt];
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < divisorCnt; ++j) {
          aJump[i][j] = j;
        }
      }
      for (int pIdx = 0; pIdx < pCnt; ++pIdx) {
        long p = pk[pIdx];
        for (int i = 0; i < divisorCnt; ++i) {
          expCnt[i] = 0;
          for (long d = divisors[i]; d % p == 0; ) {
            d /= p;
            divisorJump[i][expCnt[i]++] = Arrays.binarySearch(divisors, 0, divisorCnt, d);
          }
        }
        for (int i = 0; i < n; ++i) {
          int cnt = 0;
          long remA = a[i];
          for (; remA % p == 0; remA /= p, ++cnt) {
          }
          if (cnt == 0) continue;
          for (int j = 0; j < divisorCnt; ++j)
            if (expCnt[j] > 0) {
              aJump[i][j] = divisorJump[aJump[i][j]][Math.min(expCnt[j], cnt) - 1];
            }
        }
      }
    }
 
    void calc() {
      minCnt = new int[n + 1][divisorCnt];
      minSum = new long[n + 1][divisorCnt];
      fromSum = new int[n + 1][divisorCnt];
      for (int i = 0; i <= n; ++i) {
        Arrays.fill(minCnt[i], Integer.MAX_VALUE);
        Arrays.fill(minSum[i], Long.MAX_VALUE);
        Arrays.fill(fromSum[i], -1);
      }
      minCnt[0][divisorCnt - 1] = 0;
      minSum[0][divisorCnt - 1] = 0;
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < divisorCnt; ++j) {
          if (minCnt[i][j] == Integer.MAX_VALUE) continue;
          int nxtJ = aJump[i][j];
          update(i + 1, j, j, minCnt[i][j], minSum[i][j]);
          update(i + 1, nxtJ, j, minCnt[i][j] + 1, minSum[i][j] + a[i]);
        }
      }
    }
 
    void update(int newI, int newJ, int j, int cnt, long sum) {
      if (minCnt[newI][newJ] > cnt
          || (minCnt[newI][newJ] == cnt && minSum[newI][newJ] > sum)) {
        minCnt[newI][newJ] = cnt;
        minSum[newI][newJ] = sum;
        fromSum[newI][newJ] = j;
      }
    }
 
  }
 
  static class QuickWriter {
    private final PrintWriter writer;
 
    public QuickWriter(OutputStream outputStream) {
      this.writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }
 
    public QuickWriter(Writer writer) {
      this.writer = new PrintWriter(writer);
    }
 
    public void print(Object... objects) {
      for (int i = 0; i < objects.length; ++i) {
        if (i > 0) {
          writer.print(' ');
        }
        writer.print(objects[i]);
      }
    }
 
    public void println(Object... objects) {
      print(objects);
      writer.print('\n');
    }
 
    public void close() {
      writer.close();
    }
 
  }
 
  static interface IntCollection {
  }
 
  static class LongUtils {
    public static int factorize(long n, long[] p, int[] r) {
      int res = 0;
      for (long i = 2; i <= n / i; ++i)
        if (n % i == 0) {
          int rCnt = 1;
          for (n /= i; n % i == 0; n /= i, ++rCnt) {
          }
          p[res] = i;
          r[res++] = rCnt;
        }
      if (n > 1) {
        p[res] = n;
        r[res++] = 1;
      }
      return res;
    }
 
    public static int divisors(long n, long[] divisors) {
      int res = 0;
      divisors[res++] = 1;
      for (long i = 2; i <= n / i; ++i)
        if (n % i == 0) {
          divisors[res++] = i;
        }
      int pnt = res - 1;
      if (divisors[pnt] != n / divisors[pnt]) {
        divisors[res++] = n / divisors[pnt];
      }
      for (int i = --pnt; i >= 0; i--) {
        divisors[res++] = n / divisors[i];
      }
      return res;
    }
 
  }
 
  static class QuickScanner {
    private static final int BUFFER_SIZE = 1024;
    private InputStream stream;
    private byte[] buffer;
    private int currentPostion;
    private int numberOfChars;
 
    public QuickScanner(InputStream stream) {
      this.stream = stream;
      this.buffer = new byte[BUFFER_SIZE];
      this.currentPostion = 0;
      this.numberOfChars = 0;
    }
 
    public int nextInt() {
      int c = nextNonSpaceChar();
      boolean positive = true;
      if (c == '-') {
        positive = false;
        c = nextChar();
      }
      int res = 0;
      do {
        if (c < '0' || '9' < c) throw new RuntimeException();
        res = res * 10 + c - '0';
        c = nextChar();
      } while (!isSpaceChar(c));
      return positive ? res : -res;
    }
 
    public long nextLong() {
      int c = nextNonSpaceChar();
      boolean positive = true;
      if (c == '-') {
        positive = false;
        c = nextChar();
      }
      long res = 0;
      do {
        if (c < '0' || '9' < c) throw new RuntimeException();
        res = res * 10 + c - '0';
        c = nextChar();
      } while (!isSpaceChar(c));
      return positive ? res : -res;
    }
 
    public void nextLong(int n, long[] res) {
      for (int i = 0; i < n; ++i) {
        res[i] = nextLong();
      }
    }
 
    public int nextNonSpaceChar() {
      int res = nextChar();
      for (; isSpaceChar(res) || res < 0; res = nextChar()) ;
      return res;
    }
 
    public int nextChar() {
      if (numberOfChars == -1) {
        throw new RuntimeException();
      }
      if (currentPostion >= numberOfChars) {
        currentPostion = 0;
        try {
          numberOfChars = stream.read(buffer);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
        if (numberOfChars <= 0) {
          return -1;
        }
      }
      return buffer[currentPostion++];
    }
 
    public boolean isSpaceChar(int c) {
      return c == ' '
          || c == '\n'
          || c == '\r'
          || c == '\t'
          || c < 0;
    }
 
  }
 
  static class IntArrayList implements IntCollection {
    private int[] values;
    private int close;
 
    public IntArrayList(int capacity) {
      values = new int[Integer.highestOneBit(capacity) << 1];
    }
 
 
    public int size() {
      return close;
    }
 
 
    public void add(int v) {
      ensureCapacity(size() + 1);
      values[close++] = v;
    }
 
    public int get(int idx) {
      if (idx >= close) throw new ArrayIndexOutOfBoundsException();
      return values[idx];
    }
 
    protected void ensureCapacity(int capacity) {
      if (capacity < values.length) return;
      int[] newValues = new int[Integer.highestOneBit(capacity) << 1];
      System.arraycopy(values, 0, newValues, 0, values.length);
      close = size();
      values = newValues;
    }
 
  }
 
  static class LongArrayUtils {
    public static long min(long[] values) {
      long res = Long.MAX_VALUE;
      for (long value : values) {
        res = Math.min(res, value);
      }
      return res;
    }
 
  }
}