#include <bits/stdc++.h>
using namespace std;
const int maxn = 233;
const int maxm = 233333;
const int inf = 987654321;
int z[maxm];
vector<int> pr;
int a[maxn];
int f[maxn][maxn];
int stk[maxn], d[maxn], Now[maxn], Limit[maxn], I[maxn];
vector<int> g[maxn];
vector<int> odd, even;
vector<vector<int> > ans;
int T;
bool P[maxn];
queue<int> que;
bool Re_num() {
  for (int i = 0; i <= T; ++i) d[i] = 0;
  d[0] = 1;
  while (!que.empty()) que.pop();
  que.push(0);
  while (!que.empty()) {
    int u = que.front();
    que.pop();
    for (int i = 0; i < (int)g[u].size(); ++i)
      if (f[u][g[u][i]] > 0 && d[g[u][i]] == 0) {
        d[g[u][i]] = d[u] + 1;
        que.push(g[u][i]);
      }
  }
  return d[T] > 0;
}
int Dinic() {
  int t = 1;
  stk[t] = 0;
  Now[t] = 0;
  Limit[t] = inf;
  I[t] = 0;
  while (t) {
    if (stk[t] == T) {
      Now[t - 1] += Limit[t];
      f[stk[t - 1]][T] -= Limit[t];
      --t;
      continue;
    }
    bool Next = 0;
    int u = stk[t];
    for (; I[t] < (int)(g[u].size()) && !Next && Now[t] < Limit[t]; ++I[t])
      if (f[u][g[u][I[t]]] > 0 && d[g[u][I[t]]] == d[u] + 1) {
        stk[t + 1] = g[u][I[t]];
        Now[t + 1] = 0;
        Limit[t + 1] = min(f[u][g[u][I[t]]], Limit[t] - Now[t]);
        I[t + 1] = 0;
        Next = 1;
      }
    if (Next)
      ++t;
    else {
      Now[t - 1] += Now[t];
      f[stk[t - 1]][stk[t]] -= Now[t];
      f[stk[t]][stk[t - 1]] += Now[t];
      if (Now[t] < Limit[t]) d[stk[t]] = -1;
      --t;
    }
  }
  return Now[1];
}
int main() {
  for (int i = 2; i <= 20000; ++i) {
    if (!z[i]) pr.push_back(i);
    for (int j = 0; j < (int)pr.size() && i * pr[j] <= 20000; ++j) {
      z[i * pr[j]] = 1;
      if (i % pr[j] == 0) break;
    }
  }
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (a[i] & 1)
      odd.push_back(i);
    else
      even.push_back(i);
  }
  if (odd.size() != even.size()) {
    printf("Impossible\n");
    return 0;
  }
  T = n + 1;
  int m = n >> 1;
  for (int i = 1; i <= m; ++i) {
    g[0].push_back(i);
    f[0][i] = 2;
  }
  for (int i = m + 1; i <= n; ++i) {
    g[i].push_back(T);
    f[i][T] = 2;
  }
  for (int i = 0; i < m; ++i)
    for (int j = 0; j < m; ++j)
      if (!z[a[odd[i]] + a[even[j]]]) {
        g[i + 1].push_back(j + m + 1);
        g[j + m + 1].push_back(i + 1);
        f[i + 1][j + m + 1] = 1;
      }
  int sum = 0;
  while (Re_num()) sum += Dinic();
  if (sum < n)
    printf("Impossible\n");
  else {
    for (int i = 1; i <= m; ++i)
      if (!P[i]) {
        vector<int> tmp;
        tmp.clear();
        for (int u = i, v = 0; !P[u];) {
          P[u] = 1;
          for (int j = 0; j < (int)g[u].size(); ++j)
            if (f[g[u][j]][u] == 1 && g[u][j] != v) {
              v = g[u][j];
              break;
            }
          tmp.push_back(odd[u - 1]);
          tmp.push_back(even[v - 1 - m]);
          for (int j = 0; j < (int)g[v].size(); ++j)
            if (f[v][g[v][j]] == 1 && g[v][j] != u) {
              u = g[v][j];
              break;
            }
        }
        ans.push_back(tmp);
      }
    printf("%d\n", (int)ans.size());
    for (int i = 0; i < (int)ans.size(); ++i) {
      printf("%d", (int)ans[i].size());
      for (int j = 0; j < (int)ans[i].size(); ++j) printf(" %d", ans[i][j]);
      printf("\n");
    }
  }
  return 0;
}
