#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 201;
const long long MOD = 1000000007;
const int INF32 = 0x3f3f3f3f;
const long long INF = 1e18;
struct Edge {
  int v, u;
  long long cap, flow = 0;
  Edge(int v, int u, long long cap) : v(v), u(u), cap(cap) {}
};
class Dinic {
  const long long flow_inf = 1e18;
  vector<vector<int>> adj;
  int n, m = 0;
  int second, t;
  vector<int> level, ptr;
  queue<int> q;
  bool bfs() {
    while (!q.empty()) {
      int v = q.front();
      q.pop();
      for (int id : adj[v]) {
        if (edges[id].cap - edges[id].flow < 1) continue;
        if (level[edges[id].u] != -1) continue;
        level[edges[id].u] = level[v] + 1;
        q.push(edges[id].u);
      }
    }
    return level[t] != -1;
  }
  long long dfs(int v, long long pushed) {
    if (pushed == 0) return 0;
    if (v == t) return pushed;
    for (int& cid = ptr[v]; cid < (int)adj[v].size(); cid++) {
      int id = adj[v][cid];
      int u = edges[id].u;
      if (level[v] + 1 != level[u] || edges[id].cap - edges[id].flow < 1)
        continue;
      long long tr = dfs(u, min(pushed, edges[id].cap - edges[id].flow));
      if (tr == 0) continue;
      edges[id].flow += tr;
      edges[id ^ 1].flow -= tr;
      return tr;
    }
    return 0;
  }

 public:
  vector<Edge> edges;
  Dinic(int n, int second, int t) : n(n), second(second), t(t) {
    adj.resize(n);
    level.resize(n);
    ptr.resize(n);
  }
  void add_edge(int v, int u, long long cap) {
    edges.emplace_back(v, u, cap);
    edges.emplace_back(u, v, 0);
    adj[v].push_back(m);
    adj[u].push_back(m + 1);
    m += 2;
  }
  long long flow() {
    long long first = 0;
    while (true) {
      fill(level.begin(), level.end(), -1);
      level[second] = 0;
      q.push(second);
      if (!bfs()) break;
      fill(ptr.begin(), ptr.end(), 0);
      while (long long pushed = dfs(second, flow_inf)) first += pushed;
    }
    return first;
  }
};
int n;
bool notprime[20001], visited[MAX_N];
vector<int> adj[MAX_N];
vector<vector<int>> cycles;
vector<pair<int, int>> even, odd;
set<int> primes;
int main(int argc, const char* argv[]) {
  cin >> n;
  Dinic dinic(n + 2, 0, 1);
  for (int i = (0); i < (n); i++) {
    int x;
    cin >> x;
    if (x & 1)
      odd.push_back({x, i});
    else
      even.push_back({x, i});
  }
  if (odd.size() != even.size()) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = (2); i < (20001); i++) {
    if (!notprime[i]) primes.insert(i);
    for (int x : primes) {
      if (i * x < 20001) notprime[i * x] = true;
      if (!(i % x) || i * x >= 20001) break;
    }
  }
  for (pair<int, int> x : odd)
    for (pair<int, int> y : even) {
      if (primes.find(x.first + y.first) == primes.end()) continue;
      dinic.add_edge(x.second + 2, y.second + 2, 1);
    }
  for (pair<int, int> x : odd) dinic.add_edge(0, x.second + 2, 2);
  for (pair<int, int> y : even) dinic.add_edge(y.second + 2, 1, 2);
  int fl = dinic.flow();
  if (fl != n) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = 0; i < dinic.edges.size(); i += 2) {
    Edge x = dinic.edges[i], y = dinic.edges[i + 1];
    if (x.flow == x.cap && y.flow != y.cap && x.u != 1 && x.v != 1 && x.u &&
        x.v) {
      adj[x.u - 1].push_back(x.v - 1);
      adj[x.v - 1].push_back(x.u - 1);
    }
  }
  for (int i = (1); i < (n + 1); i++) {
    if (visited[i]) continue;
    vector<int> curr;
    int x = i;
    while (!visited[x]) {
      int temp = x;
      curr.push_back(x);
      visited[x] = true;
      for (int y : adj[x])
        if (!visited[y]) x = y;
    }
    cycles.push_back(curr);
  }
  cout << cycles.size() << endl;
  for (int i = (0); i < (cycles.size()); i++) {
    cout << cycles[i].size() << ' ';
    for (int j = (0); j < (cycles[i].size()); j++) cout << cycles[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
