#include <bits/stdc++.h>
using namespace std;
int n, m, len, k, t, a, b;
vector<int> Adj[210];
bool isPrime[1000000];
bool vis[210];
int par[210];
void prec() {
  memset(isPrime, true, sizeof(isPrime));
  isPrime[0] = isPrime[1] = false;
  for (long long i = 2; i <= 1000000; i++)
    if (isPrime[i]) {
      for (long long j = i * i; j <= 1000000; j += i) isPrime[j] = false;
    }
}
int arr[210];
int res[210][210];
int mf, f;
vector<int> Adj2[210];
void augment(int v, int minEdge) {
  if (v == 0)
    f = minEdge;
  else if (par[v] != -1) {
    augment(par[v], min(minEdge, res[par[v]][v]));
    res[par[v]][v] -= f;
    res[v][par[v]] += f;
  }
}
void solve() {
  mf = 0;
  while (1) {
    f = 0;
    memset(vis, false, sizeof(vis));
    memset(par, -1, sizeof(par));
    queue<int> q;
    q.push(0);
    vis[0] = true;
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      if (u == n + 1) break;
      for (auto v : Adj[u])
        if (!vis[v] && res[u][v]) {
          vis[v] = true;
          par[v] = u;
          q.push(v);
        }
    }
    augment(n + 1, 1000000007);
    if (f)
      mf += f;
    else
      break;
  }
}
vector<int> ans;
void dfs(int u) {
  vis[u] = true;
  ans.push_back(u);
  for (auto v : Adj2[u])
    if (!vis[v]) {
      dfs(v);
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  prec();
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++)
    if (arr[i] % 2 == 0) cnt++;
  for (int i = 1; i <= n - 1; i++)
    for (int j = i + 1; j <= n; j++)
      if (isPrime[arr[i] + arr[j]]) {
        Adj[i].push_back(j);
        Adj[j].push_back(i);
        if (arr[i] & 1)
          res[i][j] = 1;
        else
          res[j][i] = 1;
      }
  for (int i = 1; i <= n; i++)
    if (arr[i] & 1)
      Adj[0].push_back(i), res[0][i] = 2;
    else
      Adj[i].push_back(n + 1), res[i][n + 1] = 2;
  solve();
  if (mf != 2 * cnt) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (arr[i] % 2 == 0) {
      for (int j = 1; j <= n; j++)
        if (res[i][j]) Adj2[i].push_back(j), Adj2[j].push_back(i);
    }
  memset(vis, false, sizeof(vis));
  vector<vector<int> > anses;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      ans.clear();
      dfs(i);
      anses.push_back(ans);
    }
  cout << ((int)anses.size()) << "\n";
  for (auto v : anses) {
    cout << ((int)v.size());
    for (auto cur : v) cout << " " << cur;
    cout << "\n";
  }
  return 0;
}
