#include <bits/stdc++.h>
const long long pr = 1000000009;
using namespace std;
int ev[201] = {0};
class FlowGraph {
  vector<int> Edgelist[300];
  long long flow;
  int s, t;
  vector<int> colr[300];
  int V, E, h[300], cap[300][300], fl[300][300], cf[300][300], e[300];
  void push(int u, int v) {
    int temp = min(e[u], cf[u][v]);
    if (v == t) flow += temp;
    fl[u][v] = fl[u][v] + temp;
    fl[v][u] = -fl[u][v];
    e[u] = e[u] - temp;
    e[v] = e[v] + temp;
    cf[u][v] = cap[u][v] - fl[u][v];
    cf[v][u] = cap[v][u] - fl[v][u];
  }
  void relabel(int u) {
    int temp = -1;
    for (int i = 0; i < Edgelist[u].size(); i++) {
      int v = Edgelist[u][i];
      if (cf[u][v] > 0) {
        if (temp == -1 || temp > h[v]) temp = h[v];
      }
    }
    h[u] = temp + 1;
  }

 public:
  FlowGraph(int V1, int s1, int t1) {
    V = V1;
    s = s1;
    t = t1;
    flow = 0;
    memset(cap, 0, sizeof(cap));
    memset(e, 0, sizeof(e));
    memset(fl, 0, sizeof(fl));
    memset(cf, 0, sizeof(cf));
  }
  int cntr;
  void Dfs();
  void DFSV(int vertx, vector<int> &visited, int clr);
  void initialize_preflow();
  int max_flow();
  void add_edge(int u, int v, int cap_uv, int cap_vu) {
    Edgelist[u].push_back(v);
    Edgelist[v].push_back(u);
    cap[u][v] = cap_uv;
    cap[v][u] = cap_vu;
    cf[v][u] = cap_vu;
    cf[u][v] = cap_uv;
  }
};
void FlowGraph::Dfs() {
  vector<int> visited(V, 0);
  visited[s] = visited[t] = 1;
  int clr = 0;
  for (int i = 0; i < V; i++) {
    if (!visited[i]) DFSV(i, visited, clr++);
  }
  cout << clr << endl;
  for (int i = 0; i < clr; i++) {
    cout << colr[i].size() << ' ';
    for (int j = 0; j < colr[i].size(); j++) {
      cout << colr[i][j] + 1 << ' ';
    }
    cout << endl;
  }
}
void FlowGraph::DFSV(int vertx, vector<int> &visited, int clr) {
  if (vertx == s || vertx == t) return;
  visited[vertx] = 1;
  colr[clr].push_back(vertx);
  for (int i = 0; i < Edgelist[vertx].size(); i++) {
    int nxt = Edgelist[vertx][i];
    if ((fl[vertx][nxt] || fl[nxt][vertx])) {
      if (!visited[nxt]) DFSV(nxt, visited, clr);
    }
  }
}
void FlowGraph::initialize_preflow() {
  memset(h, 0, sizeof(h));
  h[s] = V;
  for (int i = V - 1; i >= 0; i--) {
    memset(fl[i], 0, sizeof(fl[i]));
  }
  for (int i = 0; i < Edgelist[s].size(); i++) {
    int v = Edgelist[s][i];
    fl[s][v] = cap[s][v];
    fl[v][s] = -1 * cap[s][v];
    e[v] += fl[s][v];
    e[s] -= fl[s][v];
    cf[s][v] = 0;
    cf[v][s] = cap[v][s] - fl[v][s];
  }
}
int FlowGraph::max_flow() {
  initialize_preflow();
  queue<int> Q;
  int u, v, m;
  vector<bool> bits(V + 1, 0);
  for (int i = 0; i < Edgelist[s].size(); i++) {
    if (Edgelist[s][i] != t) {
      Q.push(Edgelist[s][i]);
      bits[Edgelist[s][i]] = 1;
    } else
      flow += cap[s][t];
  }
  int cnt = 0;
  while (!Q.empty()) {
    cnt++;
    int u = Q.front();
    m = -1;
    for (int i = 0; i < Edgelist[u].size() && e[u] > 0; i++) {
      v = Edgelist[u][i];
      if (cf[u][v] > 0) {
        if (h[u] > h[v]) {
          push(u, v);
          if (bits[v] == 0 && v != s && v != t) {
            bits[v] = 1;
            Q.push(v);
          }
        } else {
          if (m == -1)
            m = h[v];
          else
            m = min(h[v], m);
        }
      }
    }
    if (e[u] != 0)
      h[u] = 1 + m;
    else {
      bits[u] = 0;
      Q.pop();
    }
  }
  return flow;
}
int dp[100009];
inline bool ispr(int a) {
  if (dp[a] != -1) return dp[a];
  bool fl = true;
  int up = min((int)sqrt(a) + 1, a - 1);
  for (int i = 2; i <= up; i++) {
    if (a % i == 0) {
      fl = false;
      break;
    }
  }
  dp[a] = fl;
  return fl;
}
int main() {
  memset(dp, -1, sizeof(dp));
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = 1;
  ios::sync_with_stdio(false);
  int n, u, v, c, A[201];
  vector<int> even(0), odd(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (A[i] % 2)
      odd.push_back(i);
    else {
      even.push_back(i);
      ev[i] = 1;
    }
  }
  if (even.size() != odd.size()) {
    cout << "Impossible" << endl;
    return 0;
  }
  FlowGraph G(n + 2, n, n + 1);
  for (int i = 0; i < n / 2; i++) {
    G.add_edge(n, even[i], 2, 0);
    G.add_edge(odd[i], n + 1, 2, 0);
  }
  for (int i = 0; i < n / 2; ++i) {
    for (int j = 0; j < n / 2; j++) {
      if (ispr(A[even[i]] + A[odd[j]])) {
        G.add_edge(even[i], odd[j], 1, 0);
      }
    }
  }
  if (G.max_flow() != n) {
    cout << "Impossible" << endl;
    return 0;
  }
  G.Dfs();
  return 0;
}
