#include <bits/stdc++.h>
using namespace std;
struct MaxFlow {
  struct Edge {
    int u, v;
    int f, c;
    Edge(int u, int v, int f, int c) : u(u), v(v), f(f), c(c) {}
  };
  vector<vector<int> > g;
  vector<Edge> e;
  int *ptr, *dist, *q, n, source, sink;
  MaxFlow(int n) : n(n) {
    dist = (int *)malloc(sizeof(int) * n);
    q = (int *)malloc(sizeof(int) * n);
    ptr = (int *)malloc(sizeof(int) * n);
    g.resize(n);
  }
  ~MaxFlow() {
    free(dist);
    free(ptr);
    free(q);
    g.clear();
    e.clear();
  }
  void add(int u, int v, int c, int rc = 0) {
    g[u].push_back(e.size());
    e.push_back(Edge(u, v, 0, c));
    g[v].push_back(e.size());
    e.push_back(Edge(v, u, 0, rc));
  }
  int flow(int source, int sink) {
    this->source = source;
    this->sink = sink;
    int res = 0;
    while (bfs()) {
      memset(ptr, 0, sizeof(int) * n);
      while (int pushed = dfs(source, 1e9)) res += pushed;
    }
    return res;
  }
  bool bfs() {
    memset(dist, 63, sizeof(int) * n);
    int st = 0, en = 0;
    q[en++] = source;
    dist[source] = 0;
    while (st < en) {
      int u = q[st++];
      for (int i = 0; i < (int)g[u].size(); ++i) {
        int id = g[u][i];
        int v = e[id].v;
        if (dist[v] > dist[u] + 1 && e[id].f < e[id].c) {
          dist[v] = dist[u] + 1;
          q[en++] = v;
          if (v == sink) return 1;
        }
      }
    }
    return 0;
  }
  int dfs(int u, int flow) {
    if (u == sink || flow == 0) return flow;
    for (int &i = ptr[u]; i < (int)g[u].size(); ++i) {
      int id = g[u][i];
      int v = e[id].v;
      int pushed;
      if (dist[v] == dist[u] + 1 &&
          (pushed = dfs(v, min(flow, e[id].c - e[id].f)))) {
        e[id].f += pushed;
        e[id ^ 1].f -= pushed;
        return pushed;
      }
    }
    return 0;
  }
};
vector<vector<int> > ans;
vector<int> g[205 + 1];
vector<bool> vis(205 + 1);
void dfs(int u, vector<int> &x) {
  x.push_back(u);
  vis[u] = 1;
  for (int i = 0; i < g[u].size(); ++i) {
    int v = g[u][i];
    if (vis[v]) continue;
    assert(v ^ u);
    dfs(v, x);
  }
}
bool isPrime[(int)1e5 + 1];
int main() {
  memset(isPrime, 1, sizeof isPrime);
  for (int i = 2; i <= 1e5; ++i) {
    if (isPrime[i])
      for (int j = i + i; j <= 1e5; j += i) isPrime[j] = 0;
  }
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  MaxFlow mf(n + 2);
  int source = 0, sink = n + 1;
  int a[1001];
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    if (a[i] & 1) {
      mf.add(i, sink, 2);
      continue;
    }
    mf.add(source, i, 2);
    for (int j = 1; j <= n; ++j)
      if (a[j] & 1 && isPrime[a[i] + a[j]]) mf.add(i, j, 1);
  }
  int ret = mf.flow(source, sink);
  if (ret ^ n)
    cout << "Impossible\n";
  else {
    vector<MaxFlow::Edge> &e = mf.e;
    for (int i = 0; i < e.size(); ++i) {
      int u = e[i].u;
      int v = e[i].v;
      if (e[i].f == 1 || e[i].f == 0)
        assert(u >= 1 && u <= n && v >= 1 && v <= n);
      if (e[i].f == 2) assert(u == source || v == sink);
      if (e[i].f == 1) g[u].push_back(v), g[v].push_back(u);
    }
    for (int i = 1; i <= n; ++i)
      if (!vis[i]) {
        ans.push_back(vector<int>());
        dfs(i, ans.back());
      }
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); ++i) {
      cout << ans[i].size() << " ";
      for (int j = 0; j < ans[i].size(); ++j) cout << ans[i][j] << " ";
      cout << "\n";
    }
  }
}
