#include <bits/stdc++.h>
using namespace std;
using namespace std;
struct Edge {
  int u, v, flow, next;
} edge[2000100];
int head[4001], nEdge;
int dis[4001], cur[4001];
int que[4001], front, tail;
int stk[4001], top;
void init() {
  memset(head, -1, sizeof(head));
  nEdge = 0;
}
void addEdge(int a, int b, int f) {
  edge[nEdge].u = a;
  edge[nEdge].v = b;
  edge[nEdge].flow = f;
  edge[nEdge].next = head[a];
  head[a] = nEdge++;
  edge[nEdge].u = b;
  edge[nEdge].v = a;
  edge[nEdge].flow = 0;
  edge[nEdge].next = head[b];
  head[b] = nEdge++;
}
bool bfs(int src, int dst) {
  int i, p, cur;
  memset(dis, -1, sizeof(dis));
  front = tail = 0;
  dis[src] = 0;
  que[tail++] = src;
  while (front < tail) {
    cur = que[front++];
    for (i = head[cur]; ~i; i = edge[i].next) {
      if (edge[i].flow && dis[p = edge[i].v] < 0) {
        dis[p] = dis[cur] + 1;
        if (p == dst) return true;
        que[tail++] = p;
      }
    }
  }
  return false;
}
int dinic(int v, int src, int dst) {
  int i, x = src, p, nowFlow, totalFlow = 0;
  while (bfs(src, dst)) {
    top = 0;
    for (i = 0; i < v; ++i) cur[i] = head[i];
    while (1) {
      if (x == dst) {
        nowFlow = 1000000000;
        for (i = 0; i < top; ++i) {
          if (edge[stk[i]].flow < nowFlow) {
            nowFlow = edge[stk[i]].flow;
            p = i;
          }
        }
        totalFlow += nowFlow;
        for (i = 0; i < top; ++i) {
          edge[stk[i]].flow -= nowFlow;
          edge[stk[i] ^ 1].flow += nowFlow;
        }
        top = p;
        x = edge[stk[top]].u;
      }
      for (i = cur[x]; ~i; i = edge[i].next) {
        if (edge[i].flow && dis[edge[i].v] == dis[x] + 1) break;
      }
      cur[x] = i;
      if (~i) {
        stk[top++] = i;
        x = edge[i].v;
      } else {
        if (!top) break;
        dis[x] = -1;
        x = edge[stk[--top]].u;
      }
    }
  }
  return totalFlow;
}
vector<vector<int> > ans;
vector<int> ed[400];
int vis[400];
int a[301];
int pr[110000];
int main() {
  int i, j, n, m;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 2; i <= 22222; i++) pr[i] = 1;
  for (i = 2; i <= 22222; i++)
    if (pr[i])
      for (j = i + i; j <= 22222; j += i) pr[j] = 0;
  init();
  for (i = 1; i <= n; i++) {
    if (a[i] % 2 == 0)
      addEdge(0, i, 2);
    else
      addEdge(i, n + 1, 2);
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (a[i] % 2 == 0 && a[j] % 2 != 0)
        if (pr[a[i] + a[j]]) addEdge(i, j, 1);
  int ss = dinic(n + 2, 0, n + 1);
  if (ss != n) {
    puts("Impossible");
    return 0;
  }
  for (i = 0; i < nEdge; i += 2) {
    int u = edge[i].v;
    if (u != n + 1 && edge[i ^ 1].v != 0 && edge[i].flow == 0) {
      ed[edge[i ^ 1].v].push_back(u);
      ed[u].push_back(edge[i ^ 1].v);
    }
  }
  for (i = 1; i <= n; i++)
    if (!vis[i]) {
      vector<int> tmp;
      int last = ed[i][0];
      int now = i;
      do {
        int cur;
        if (ed[now][0] == last)
          cur = ed[now][1];
        else
          cur = ed[now][0];
        tmp.push_back(cur);
        vis[cur] = 1;
        last = now;
        now = cur;
      } while (now != i);
      ans.push_back(tmp);
    }
  int sz = ans.size();
  printf("%d\n", sz);
  for (i = 0; i < sz; i++) {
    printf("%d", ans[i].size());
    for (j = 0; j < ans[i].size(); j++) printf(" %d", ans[i][j]);
    puts("");
  }
  return 0;
}
