description: A bow adorned with nameless flowers that bears the earnest hopes of an equally nameless person.
  
  You have obtained the elegant bow known as the Windblume Ode. Inscribed in the weapon is an array of n (n ≥ 3) positive distinct integers (i.e. different, no duplicates are allowed).
  
  Find the largest subset (i.e. having the maximum number of elements) of this array such that its sum is a composite number. A positive integer x is called composite if there exists a positive integer y such that 1 < y < x and x is divisible by y.
  
  If there are multiple subsets with this largest size with the composite sum, you can output any of them. It can be proven that under the constraints of the problem such a non-empty subset always exists.
  
  Input
  
  Each test consists of multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 100). Description of the test cases follows.
  
  The first line of each test case contains an integer n (3 ≤ n ≤ 100) — the length of the array.
  
  The second line of each test case contains n distinct integers a_{1},a_{2},...,a_{n} (1 ≤ a_{i} ≤ 200) — the elements of the array.
  
  Output
  
  Each test case should have two lines of output.
  
  The first line should contain a single integer x: the size of the largest subset with composite sum. The next line should contain x space separated integers representing the indices of the subset of the initial array.
  
  Example
  
  Input
  
  
  4
  3
  8 1 2
  4
  6 9 4 2
  9
  1 2 3 4 5 6 7 8 9
  3
  200 199 198
  
  
  Output
  
  
  2
  2 1
  4
  2 1 4 3
  9
  6 9 1 2 3 4 5 7 8
  3
  1 2 3 
  
  Note
  
  In the first test case, the subset \\{a_2, a_1\} has a sum of 9, which is a composite number. The only subset of size 3 has a prime sum equal to 11. Note that you could also have selected the subset \\{a_1, a_3\} with sum 8 + 2 = 10, which is composite as it's divisible by 2.
  
  In the second test case, the sum of all elements equals to 21, which is a composite number. Here we simply take the whole array as our subset.
solution: 
  import java.io.IOException;
  import java.io.InputStream;
  import java.util.*;
  import java.util.concurrent.ThreadLocalRandom;
  
  public class Q1 {
  
    /**
     * Template @author William Fiset, william.alexandre.fiset@gmail.com
     *
     */
    static InputReader in = new InputReader(System.in);
    private Scanner sc = new Scanner(System.in);
  
    static class InputReader {
  
      private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
      private static final InputStream DEFAULT_STREAM = System.in;
      private static final int MAX_DECIMAL_PRECISION = 21;
      private int c;
      private byte[] buf;
      private int bufferSize, bufIndex, numBytesRead;
  
      private InputStream stream;
  
      private static final byte EOF = -1;
      private static final byte NEW_LINE = 10;
      private static final byte SPACE = 32;
      private static final byte DASH = 45;
      private static final byte DOT = 46;
  
      private char[] charBuffer;
  
      private static byte[] bytes = new byte[58];
      private static int[] ints = new int[58];
      private static char[] chars = new char[128];
  
      static {
        char ch = ' ';
        int value = 0;
        byte _byte = 0;
        for (int i = 48; i < 58; i++) {
          bytes[i] = _byte++;
        }
        for (int i = 48; i < 58; i++) {
          ints[i] = value++;
        }
        for (int i = 32; i < 128; i++) {
          chars[i] = ch++;
        }
      }
  
      private static final double[][] doubles = {
        {0.0d, 0.00d, 0.000d, 0.0000d, 0.00000d, 0.000000d, 0.0000000d, 0.00000000d, 0.000000000d, 0.0000000000d, 0.00000000000d, 0.000000000000d,
          0.0000000000000d, 0.00000000000000d, 0.000000000000000d, 0.0000000000000000d, 0.00000000000000000d, 0.000000000000000000d,
          0.0000000000000000000d, 0.00000000000000000000d, 0.000000000000000000000d},
        {0.1d, 0.01d, 0.001d, 0.0001d, 0.00001d, 0.000001d, 0.0000001d, 0.00000001d, 0.000000001d, 0.0000000001d, 0.00000000001d, 0.000000000001d,
          0.0000000000001d, 0.00000000000001d, 0.000000000000001d, 0.0000000000000001d, 0.00000000000000001d, 0.000000000000000001d,
          0.0000000000000000001d, 0.00000000000000000001d, 0.000000000000000000001d},
        {0.2d, 0.02d, 0.002d, 0.0002d, 0.00002d, 0.000002d, 0.0000002d, 0.00000002d, 0.000000002d, 0.0000000002d, 0.00000000002d, 0.000000000002d,
          0.0000000000002d, 0.00000000000002d, 0.000000000000002d, 0.0000000000000002d, 0.00000000000000002d, 0.000000000000000002d,
          0.0000000000000000002d, 0.00000000000000000002d, 0.000000000000000000002d},
        {0.3d, 0.03d, 0.003d, 0.0003d, 0.00003d, 0.000003d, 0.0000003d, 0.00000003d, 0.000000003d, 0.0000000003d, 0.00000000003d, 0.000000000003d,
          0.0000000000003d, 0.00000000000003d, 0.000000000000003d, 0.0000000000000003d, 0.00000000000000003d, 0.000000000000000003d,
          0.0000000000000000003d, 0.00000000000000000003d, 0.000000000000000000003d},
        {0.4d, 0.04d, 0.004d, 0.0004d, 0.00004d, 0.000004d, 0.0000004d, 0.00000004d, 0.000000004d, 0.0000000004d, 0.00000000004d, 0.000000000004d,
          0.0000000000004d, 0.00000000000004d, 0.000000000000004d, 0.0000000000000004d, 0.00000000000000004d, 0.000000000000000004d,
          0.0000000000000000004d, 0.00000000000000000004d, 0.000000000000000000004d},
        {0.5d, 0.05d, 0.005d, 0.0005d, 0.00005d, 0.000005d, 0.0000005d, 0.00000005d, 0.000000005d, 0.0000000005d, 0.00000000005d, 0.000000000005d,
          0.0000000000005d, 0.00000000000005d, 0.000000000000005d, 0.0000000000000005d, 0.00000000000000005d, 0.000000000000000005d,
          0.0000000000000000005d, 0.00000000000000000005d, 0.000000000000000000005d},
        {0.6d, 0.06d, 0.006d, 0.0006d, 0.00006d, 0.000006d, 0.0000006d, 0.00000006d, 0.000000006d, 0.0000000006d, 0.00000000006d, 0.000000000006d,
          0.0000000000006d, 0.00000000000006d, 0.000000000000006d, 0.0000000000000006d, 0.00000000000000006d, 0.000000000000000006d,
          0.0000000000000000006d, 0.00000000000000000006d, 0.000000000000000000006d},
        {0.7d, 0.07d, 0.007d, 0.0007d, 0.00007d, 0.000007d, 0.0000007d, 0.00000007d, 0.000000007d, 0.0000000007d, 0.00000000007d, 0.000000000007d,
          0.0000000000007d, 0.00000000000007d, 0.000000000000007d, 0.0000000000000007d, 0.00000000000000007d, 0.000000000000000007d,
          0.0000000000000000007d, 0.00000000000000000007d, 0.000000000000000000007d},
        {0.8d, 0.08d, 0.008d, 0.0008d, 0.00008d, 0.000008d, 0.0000008d, 0.00000008d, 0.000000008d, 0.0000000008d, 0.00000000008d, 0.000000000008d,
          0.0000000000008d, 0.00000000000008d, 0.000000000000008d, 0.0000000000000008d, 0.00000000000000008d, 0.000000000000000008d,
          0.0000000000000000008d, 0.00000000000000000008d, 0.000000000000000000008d},
        {0.9d, 0.09d, 0.009d, 0.0009d, 0.00009d, 0.000009d, 0.0000009d, 0.00000009d, 0.000000009d, 0.0000000009d, 0.00000000009d, 0.000000000009d,
          0.0000000000009d, 0.00000000000009d, 0.000000000000009d, 0.0000000000000009d, 0.00000000000000009d, 0.000000000000000009d,
          0.0000000000000000009d, 0.00000000000000000009d, 0.000000000000000000009d}
      };
  
      public InputReader() {
        this(DEFAULT_STREAM, DEFAULT_BUFFER_SIZE);
      }
  
      public InputReader(int bufferSize) {
        this(DEFAULT_STREAM, bufferSize);
      }
  
      public InputReader(InputStream stream) {
        this(stream, DEFAULT_BUFFER_SIZE);
      }
  
      public InputReader(InputStream stream, int bufferSize) {
        if (stream == null || bufferSize <= 0) {
          throw new IllegalArgumentException();
        }
        buf = new byte[bufferSize];
        charBuffer = new char[128];
        this.bufferSize = bufferSize;
        this.stream = stream;
      }
  
      private byte read() throws IOException {
  
        if (numBytesRead == EOF) {
          throw new IOException();
        }
  
        if (bufIndex >= numBytesRead) {
          bufIndex = 0;
          numBytesRead = stream.read(buf);
          if (numBytesRead == EOF) {
            return EOF;
          }
        }
  
        return buf[bufIndex++];
      }
  
      private void doubleCharBufferSize() {
        char[] newBuffer = new char[charBuffer.length << 1];
        for (int i = 0; i < charBuffer.length; i++) {
          newBuffer[i] = charBuffer[i];
        }
        charBuffer = newBuffer;
      }
  
      private int readJunk(int token) throws IOException {
  
        if (numBytesRead == EOF) {
          return EOF;
        }
  
        do {
  
          while (bufIndex < numBytesRead) {
            if (buf[bufIndex] > token) {
              return 0;
            }
            bufIndex++;
          }
  
          numBytesRead = stream.read(buf);
          if (numBytesRead == EOF) {
            return EOF;
          }
          bufIndex = 0;
  
        } while (true);
  
      }
  
      public byte nextByte() throws IOException {
        return (byte) nextInt();
      }
  
      public int nextInt() throws IOException {
  
        if (readJunk(DASH - 1) == EOF) {
          throw new IOException();
        }
        int sgn = 1, res = 0;
  
        c = buf[bufIndex];
        if (c == DASH) {
          sgn = -1;
          bufIndex++;
        }
  
        do {
  
          while (bufIndex < numBytesRead) {
            if (buf[bufIndex] > SPACE) {
              res = (res << 3) + (res << 1);
              res += ints[buf[bufIndex++]];
            } else {
              bufIndex++;
              return res * sgn;
            }
          }
  
          numBytesRead = stream.read(buf);
          if (numBytesRead == EOF) {
            return res * sgn;
          }
          bufIndex = 0;
  
        } while (true);
  
      }
  
      public int[] nextIntArray(int n) throws IOException {
        int[] ar = new int[n];
        for (int i = 0; i < n; i++) {
          ar[i] = nextInt();
        }
        return ar;
      }
  
      public void close() throws IOException {
        stream.close();
      }
  
      public long nextLong() throws IOException {
        if (readJunk(DASH - 1) == EOF) {
          throw new IOException();
        }
        int sgn = 1;
        long res = 0L;
        c = buf[bufIndex];
        if (c == DASH) {
          sgn = -1;
          bufIndex++;
        }
        do {
          while (bufIndex < numBytesRead) {
            if (buf[bufIndex] > SPACE) {
              res = (res << 3) + (res << 1);
              res += ints[buf[bufIndex++]];
            } else {
              bufIndex++;
              return res * sgn;
            }
          }
          numBytesRead = stream.read(buf);
          if (numBytesRead == EOF) {
            return res * sgn;
          }
          bufIndex = 0;
        } while (true);
      }
  
      public String nextString() throws IOException {
        if (numBytesRead == EOF) {
          return null;
        }
        if (readJunk(SPACE) == EOF) {
          return null;
        }
  
        for (int i = 0;;) {
          while (bufIndex < numBytesRead) {
            if (buf[bufIndex] > SPACE) {
              if (i == charBuffer.length) {
                doubleCharBufferSize();
              }
              charBuffer[i++] = (char) buf[bufIndex++];
            } else {
              bufIndex++;
              return new String(charBuffer, 0, i);
            }
          }
  
          // Reload buffer
          numBytesRead = stream.read(buf);
          if (numBytesRead == EOF) {
            return new String(charBuffer, 0, i);
          }
          bufIndex = 0;
        }
      }
    }
  
    public static void main(String args[]) throws Exception {
      int t = in.nextInt();
      while (t-- != 0) {
        solve();
      }
    }
  
    static void solve() throws IOException {
      int n;
      n = in.nextInt();
      int[] arr = in.nextIntArray(n);
      boolean[] prime = sieveOfEratosthenes(20000);
      PriorityQueue<set> pq = new PriorityQueue<set>((a, b) -> b.size - a.size);
      int sum = 0;
      HashMap<Integer, Integer> hm = new HashMap();
      for (int i : arr) {
        sum += i;
        hm.put(i, hm.size()+1);
      }
      set start = new set(arr, n, sum);
      pq.add(start);
      while (!pq.isEmpty()) {
        set s = pq.poll();
        if (!prime[s.sum]) {
          System.out.println(s.size);
          for (int i : s.arr) {
            System.out.print(hm.get(i) + " ");
          }
          break;
        } else {
          for (int i : s.arr) {
            ArrayList<Integer> list = new ArrayList();
            for (int j = 0;j<s.size;j++) {
              if (s.arr[j] == i) {
                continue;
              } else {
                list.add(s.arr[j]);
              }
            }
            int[] newarr = new int[list.size()];
            for (int j = 0;j<list.size();j++) {
              newarr[j] = list.get(j);
            }
            set nextset = new set(newarr, list.size(), s.sum - i);
            pq.add(nextset);
          }
        }
      }
      System.out.println();
    }
  
    static class set {
  
      int[] arr;
      int sum;
      int size;
  
      set(int[] arr, int size, int sum) {
        this.arr = arr;
        this.size = size;
        this.sum = sum;
      }
    }
  
    static boolean[] sieveOfEratosthenes(int n) {
      // Create a boolean array "prime[0..n]" and initialize
      // all entries it as true. A value in prime[i] will
      // finally be false if i is Not a prime, else true.
      boolean prime[] = new boolean[n + 1];
      for (int i = 0; i <= n; i++) {
        prime[i] = true;
      }
  
      for (int p = 2; p * p <= n; p++) {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true) {
          // Update all multiples of p
          for (int i = p * p; i <= n; i += p) {
            prime[i] = false;
          }
        }
      }
      return prime;
    }
  }
  