#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 210, M = 1e5 + 10;
int n, a[N], vis[M], prime[M], sz;
vector<int> v[N];
int head[N], nex[M], to[M], w[M], tot = 1, s, t, h[N];
inline void ade(int a, int b, int c) {
  to[++tot] = b;
  nex[tot] = head[a];
  w[tot] = c;
  head[a] = tot;
}
inline void add(int a, int b, int c) {
  ade(a, b, c);
  ade(b, a, 0);
}
inline int bfs() {
  queue<int> q;
  q.push(s);
  memset(h, 0, sizeof h);
  h[s] = 1;
  while (q.size()) {
    int u = q.front();
    q.pop();
    for (int i = head[u]; i; i = nex[i]) {
      if (!h[to[i]] && w[i]) {
        h[to[i]] = h[u] + 1;
        q.push(to[i]);
      }
    }
  }
  return h[t];
}
int dfs(int x, int f) {
  if (x == t) return f;
  int fl = 0;
  for (int i = head[x]; i && f; i = nex[i]) {
    if (w[i] && h[to[i]] == h[x] + 1) {
      int mi = dfs(to[i], min(w[i], f));
      w[i] -= mi, w[i ^ 1] += mi, fl += mi, f -= mi;
    }
  }
  if (!fl) h[x] = -1;
  return fl;
}
inline int dinic() {
  int res = 0;
  while (bfs()) res += dfs(s, inf);
  return res;
}
inline void get_prime(int n) {
  for (int i = 2; i <= n; i++) {
    if (!prime[i]) {
      for (int j = i + i; j <= n; j += i) prime[j] = 1;
    }
  }
}
void dfs(int x, int fa, int flag, int k) {
  if (x == fa && flag) return;
  v[fa].push_back(x);
  vis[x] = 1;
  for (int i = head[x]; i; i = nex[i]) {
    if (!vis[to[i]] && w[i ^ k]) {
      dfs(to[i], fa, 1, k ^ 1);
      break;
    }
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n;
  get_prime(M - 5);
  t = n + 1;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    if (a[i] & 1)
      add(s, i, 2);
    else
      add(i, t, 2);
  }
  for (int i = 1; i <= n; i++) {
    if (!(a[i] & 1)) continue;
    for (int j = 1; j <= n; j++) {
      if (prime[a[i] + a[j]]) continue;
      add(i, j, 1);
    }
  }
  if (dinic() != n) {
    cout << "Impossible" << '\n';
    return 0;
  }
  vis[0] = vis[t] = 1;
  for (int i = 1; i <= n; i++) {
    if (!(a[i] & 1)) continue;
    if (vis[i]) continue;
    dfs(i, i, 0, 1);
    sz++;
  }
  cout << sz << '\n';
  for (int i = 1; i <= n; i++) {
    if (!v[i].size()) continue;
    cout << v[i].size();
    for (int j = 0; j < v[i].size(); j++) cout << ' ' << v[i][j];
    cout << '\n';
  }
  return 0;
}
