#include <bits/stdc++.h>
using namespace std;
int evp;
int odp;
int idx[250];
int a[250];
int res[250][250];
vector<int> adj[250];
int mf;
int f;
vector<int> p;
int s, t;
int idxr[250];
vector<int> adjr[250];
vector<vector<int> > ans;
vector<int> tbl;
bool vis2[250];
bool isPrime(int n) {
  if (n == 1) return 0;
  if (n == 2) return 1;
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return 0;
  return 1;
}
void augment(int v, int minEdge) {
  if (v == s) {
    f = minEdge;
    return;
  } else if (p[v] != -1) {
    augment(p[v], min(minEdge, res[p[v]][v]));
    res[p[v]][v] -= f;
    res[v][p[v]] += f;
  }
}
void fillTable(int v) {
  if (vis2[v]) return;
  vis2[v] = 1;
  tbl.push_back(v);
  for (int i = int(0); i <= int(adjr[v].size() - 1); i++) fillTable(adjr[v][i]);
}
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 1) {
    printf("Impossible\n");
    return 0;
  }
  evp = n / 2;
  for (int i = int(0); i <= int(n - 1); i++) {
    cin >> a[i];
    if (a[i] % 2)
      idx[i] = ++odp;
    else
      idx[i] = ++evp;
  }
  if (odp != n / 2) {
    printf("Impossible\n");
    return 0;
  }
  memset((res), 0, sizeof(res));
  for (int i = int(0); i <= int(n - 1); i++) {
    if (a[i] % 2) {
      res[0][idx[i]] = 2;
      adj[0].push_back(idx[i]);
      adj[idx[i]].push_back(0);
      for (int j = int(0); j <= int(n - 1); j++) {
        if (a[j] % 2 == 0 && isPrime(a[i] + a[j]))
          res[idx[i]][idx[j]] = 1, adj[idx[i]].push_back(idx[j]),
          adj[idx[j]].push_back(idx[i]);
      }
    } else {
      res[idx[i]][n + 1] = 2;
      adj[idx[i]].push_back(n + 1);
      adj[n + 1].push_back(idx[i]);
    }
  }
  s = 0;
  t = n + 1;
  mf = 0;
  while (1) {
    f = 0;
    bitset<250> vis;
    vis[0] = true;
    queue<int> q;
    q.push(0);
    p.assign(250, -1);
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      if (u == t) break;
      for (int j = 0; j < (int)adj[u].size(); j++) {
        int v = adj[u][j];
        if (res[u][v] > 0 && !vis[v]) vis[v] = true, q.push(v), p[v] = u;
      }
    }
    augment(t, 2000000000);
    if (f == 0) break;
    mf += f;
  }
  if (mf != n) {
    printf("Impossible\n");
    return 0;
  }
  for (int i = int(0); i <= int(n - 1); i++) idxr[idx[i]] = i;
  for (int i = int(1); i <= int(n / 2); i++) {
    for (int j = int(n / 2); j <= int(n); j++) {
      if (res[j][i] > 0)
        adjr[idxr[j]].push_back(idxr[i]), adjr[idxr[i]].push_back(idxr[j]);
    }
  }
  memset((vis2), 0, sizeof(vis2));
  for (int i = int(0); i <= int(n - 1); i++) {
    if (!vis2[i]) {
      tbl.clear();
      fillTable(i);
      ans.push_back(tbl);
    }
  }
  printf("%d\n", ans.size());
  for (int i = int(0); i <= int(ans.size() - 1); i++) {
    printf("%d", ans[i].size());
    for (int j = int(0); j <= int(ans[i].size() - 1); j++)
      printf(" %d", ans[i][j] + 1);
    printf("\n");
  }
  return 0;
}
