#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
const int MOD = 1000000007;
const double pi = acos(-1.0);
template <int maxFlowSize>
class MaxFlow {
 public:
  class Edge {
   public:
    int from, to, upper, flow;
    Edge(int _from, int _to, int _upper) {
      from = _from;
      to = _to;
      upper = _upper;
      flow = 0;
    }
  };
  vector<int> g[maxFlowSize];
  vector<Edge> e;
  void Clear() {
    e.clear();
    for (int i = 0; i < maxFlowSize; ++i) g[i].clear();
  }
  void addEdge(int from, int to, int upper) {
    Edge e1 = Edge(from, to, upper);
    Edge e2 = Edge(to, from, 0);
    g[from].push_back(e.size());
    e.push_back(e1);
    g[to].push_back(e.size());
    e.push_back(e2);
  }
  int source, sink;
  int d[maxFlowSize];
  int q[maxFlowSize];

 private:
  bool bfs() {
    memset(d, 63, sizeof(d));
    int qh = 0, qt = 0;
    d[source] = 0;
    q[qt++] = source;
    while (qh < qt) {
      int v = q[qh++];
      for (int i = 0; i < g[v].size(); ++i) {
        int eid = g[v][i];
        if (e[eid].flow < e[eid].upper) {
          int to = e[eid].to;
          if (d[to] > d[v] + 1) {
            d[to] = d[v] + 1;
            q[qt++] = to;
          }
        }
      }
    }
    return d[sink] < maxFlowSize + 1;
  }

 private:
  int ptr[maxFlowSize];
  int dfs(int v, int cur) {
    if (cur == 0 || v == sink) return cur;
    for (; ptr[v] < g[v].size(); ++ptr[v]) {
      int eid = g[v][ptr[v]];
      int to = e[eid].to;
      if (d[to] != d[v] + 1) continue;
      int add = dfs(to, min(cur, e[eid].upper - e[eid].flow));
      if (add) {
        e[eid].flow += add;
        e[eid ^ 1].flow -= add;
        return add;
      }
    }
    return 0;
  }

 public:
  int getMaxFlow() {
    int ans = 0;
    for (;;) {
      if (!bfs()) break;
      memset(ptr, 0, sizeof(ptr));
      for (;;) {
        int cur = dfs(source, 1000000000);
        ans += cur;
        if (!cur) break;
      }
    }
    return ans;
  }
};
MaxFlow<222> net;
bool isprime[20009];
int a[222];
vector<int> G[222];
bool used[222];
void dfs(int v, vector<int> &cur) {
  cur.push_back(v);
  used[v] = true;
  for (int i = (0); i <= ((int)((G[v]).size()) - 1); ++i) {
    int to = G[v][i];
    if (used[to]) continue;
    dfs(to, cur);
  }
}
int main() {
  for (int i = (2); i <= (20000); ++i) {
    isprime[i] = true;
    for (int j = 2; j * j <= i; ++j)
      if (i % j == 0) isprime[i] = false;
  }
  int n;
  cin >> n;
  for (int i = (1); i <= (n); ++i) cin >> a[i];
  net.Clear();
  net.source = 0;
  net.sink = n + 1;
  for (int i = (1); i <= (n); ++i)
    if (a[i] % 2 == 0) {
      net.addEdge(net.source, i, 2);
    } else {
      net.addEdge(i, net.sink, 2);
    }
  for (int i = (1); i <= (n); ++i)
    if (a[i] % 2 == 0)
      for (int j = (1); j <= (n); ++j)
        if (isprime[a[i] + a[j]]) net.addEdge(i, j, 1);
  int flow = net.getMaxFlow();
  if (flow != n) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = (1); i <= (n); ++i)
    if (a[i] % 2 == 0) {
      for (int j = (0); j <= ((int)((net.g[i]).size()) - 1); ++j) {
        int to = net.e[net.g[i][j]].to;
        if (to >= 1 && to <= n && net.e[net.g[i][j]].flow > 0) {
          G[i].push_back(to);
          G[to].push_back(i);
        }
      }
    }
  memset(used, false, sizeof(used));
  vector<vector<int> > ans;
  for (int i = (1); i <= (n); ++i)
    if (!used[i]) {
      vector<int> temp;
      dfs(i, temp);
      ans.push_back(temp);
    }
  cout << (int)((ans).size()) << endl;
  for (int i = (0); i <= ((int)((ans).size()) - 1); ++i) {
    cout << (int)((ans[i]).size());
    for (int j = (0); j <= ((int)((ans[i]).size()) - 1); ++j)
      cout << " " << ans[i][j];
    cout << endl;
  }
}
