#include <bits/stdc++.h>
using namespace std;
const int MAXN = 510;
const int MAXM = 880010;
struct Node {
  int from, to, next;
  int cap;
} edge[MAXM];
int tol;
int head[MAXN];
int dep[MAXN];
int gap[MAXN];
int n;
void init() {
  tol = 0;
  memset(head, -1, sizeof(head));
}
void addedge(int u, int v, int w) {
  edge[tol].from = u;
  edge[tol].to = v;
  edge[tol].cap = w;
  edge[tol].next = head[u];
  head[u] = tol++;
  edge[tol].from = v;
  edge[tol].to = u;
  edge[tol].cap = 0;
  edge[tol].next = head[v];
  head[v] = tol++;
}
void BFS(int start, int end) {
  memset(dep, -1, sizeof(dep));
  memset(gap, 0, sizeof(gap));
  gap[0] = 1;
  int que[MAXN];
  int front, rear;
  front = rear = 0;
  dep[end] = 0;
  que[rear++] = end;
  while (front != rear) {
    int u = que[front++];
    if (front == MAXN) front = 0;
    for (int i = head[u]; i != -1; i = edge[i].next) {
      int v = edge[i].to;
      if (dep[v] != -1) continue;
      que[rear++] = v;
      if (rear == MAXN) rear = 0;
      dep[v] = dep[u] + 1;
      ++gap[dep[v]];
    }
  }
}
int SAP(int start, int end) {
  int res = 0;
  BFS(start, end);
  int cur[MAXN];
  int S[MAXN];
  int top = 0;
  memcpy(cur, head, sizeof(head));
  int u = start;
  int i;
  while (dep[start] < n) {
    if (u == end) {
      int temp = 0x3f3f3f3f;
      int inser;
      for (i = 0; i < top; i++)
        if (temp > edge[S[i]].cap) {
          temp = edge[S[i]].cap;
          inser = i;
        }
      for (i = 0; i < top; i++) {
        edge[S[i]].cap -= temp;
        edge[S[i] ^ 1].cap += temp;
      }
      res += temp;
      top = inser;
      u = edge[S[top]].from;
    }
    if (u != end && gap[dep[u] - 1] == 0) break;
    for (i = cur[u]; i != -1; i = edge[i].next)
      if (edge[i].cap != 0 && dep[u] == dep[edge[i].to] + 1) break;
    if (i != -1) {
      cur[u] = i;
      S[top++] = i;
      u = edge[i].to;
    } else {
      int min = n;
      for (i = head[u]; i != -1; i = edge[i].next) {
        if (edge[i].cap == 0) continue;
        if (min > dep[edge[i].to]) {
          min = dep[edge[i].to];
          cur[u] = i;
        }
      }
      --gap[dep[u]];
      dep[u] = min + 1;
      ++gap[dep[u]];
      if (u != start) u = edge[S[--top]].from;
    }
  }
  return res;
}
inline bool IsPr(int x) {
  for (int i = 2; i * i <= x; ++i) {
    if (x % i == 0) return 0;
  }
  return 1;
}
int a[205];
vector<int> G[205];
bool vis[205];
vector<vector<int> > ans;
vector<int> cur;
void dfs(int u, int pre) {
  cur.push_back(u);
  vis[u] = 1;
  for (int i = 0; i < (int)G[u].size(); ++i) {
    int v = G[u][i];
    if (v == pre || vis[v]) continue;
    dfs(v, u);
  }
}
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%d", a + i);
  int S = 0, T = N + 1;
  n = T + 3;
  init();
  for (int i = 1; i <= N; ++i) {
    if (a[i] & 1) {
      addedge(S, i, 2);
    } else {
      addedge(i, T, 2);
    }
    if (!(a[i] & 1)) continue;
    for (int j = 1; j <= N; ++j) {
      if (a[j] & 1) continue;
      if (IsPr(a[j] + a[i])) {
        addedge(i, j, 1);
      }
    }
  }
  int flow = SAP(S, T);
  if (flow != N) return puts("Impossible");
  for (int i = 1; i <= N; ++i) {
    if (!(a[i] & 1)) continue;
    for (int e = head[i]; ~e; e = edge[e].next) {
      if (edge[e].cap) continue;
      int v = edge[e].to;
      if (1 <= v && v <= N) G[i].push_back(v), G[v].push_back(i);
    }
  }
  for (int i = 1; i <= N; ++i) {
    if (vis[i]) continue;
    cur.clear();
    dfs(i, -1);
    ans.push_back(cur);
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); ++i) {
    printf("%d", (int)ans[i].size());
    for (int j = 0; j < (int)ans[i].size(); ++j) {
      printf(" %d", ans[i][j]);
    }
    puts("");
  }
  return 0;
}
