#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int inf = 1000000007;
const long long linf = 1000000000000000000LL;
const unsigned long long ulinf = (1ULL << 63) - 10ULL;
const double eps = 0.000001;
const double pi = 3.14159265358979323846;
template <class T>
T abs(T a) {
  return a >= 0 ? a : -a;
}
template <class T>
int sign(T a) {
  return a > eps ? 1 : a < -eps ? -1 : 0;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T mod(T a, T b) {
  T ret = a % b;
  if (ret < 0) ret += b;
  return ret;
}
template <class T>
T lowbit(T x) {
  return x & -x;
}
long long addmod(long long a, long long b, long long c) {
  return ((a + b) % c + c) % c;
}
long long mulmod(long long a, long long b, long long c) {
  if (b == 0LL) return 0LL;
  long long ret = mulmod(a, b >> 1, c);
  ret = (ret + ret) % c;
  if (b & 1LL) ret = (ret + a) % c;
  return ret;
}
long long powmod(long long a, long long b, long long c) {
  if (b == 0LL) return 1LL;
  long long ret = powmod(a, b >> 1, c);
  ret = ret * ret % c;
  if (b & 1LL) ret = ret * a % c;
  return ret;
}
long long modinv(long long a, long long b) { return powmod(a, b - 2LL, b); }
template <class T>
void maxe(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void mine(T &a, T b) {
  if (a > b) a = b;
}
int iszero(double a) { return a <= eps && a >= -eps; }
template <class T>
void geti(T &a) {
  a = 0;
  int b = 0;
  char c;
  while ((c = getchar()) == ' ' || c == '\n')
    ;
  if (c == '-')
    b = 1;
  else
    a = c - 48;
  while ((c = getchar()) != ' ' && c != '\n') a = a * 10 + c - 48;
  if (b) a = -a;
}
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int N = 222;
const int M = 22222;
const int K = 20;
const long long md = inf;
int test;
int n, m, k, ans;
int p[M];
int a[N];
vector<int> v0, v1;
vector<int> v[2][N];
vector<int> aa[N];
int t1[N], t2[N];
int uN, vN;
int g[N][N];
int linker[N];
bool used[N];
bool dfs(int u) {
  int v;
  for (v = 0; v < vN; v++)
    if (g[u][v] && !used[v]) {
      used[v] = true;
      if (linker[v] == -1 || dfs(linker[v])) {
        linker[v] = u;
        return true;
      }
    }
  return false;
}
int hungary() {
  int res = 0;
  int u;
  memset(linker, -1, sizeof(linker));
  for (u = 0; u < uN; u++) {
    memset(used, 0, sizeof(used));
    if (dfs(u)) res++;
  }
  return res;
}
void init() {
  for (int i = 2; i < M; i++)
    for (int j = i + i; j < M; j += i) p[j] = 1;
}
int getans() {
  for (int i = 1; i <= n; i++)
    if (a[i] & 1)
      v1.push_back(i);
    else
      v0.push_back(i);
  if (v0.size() != v1.size()) return 0;
  n /= 2;
  uN = vN = n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (!p[a[v0[i]] + a[v1[j]]]) g[i][j] = 1;
  int t = hungary();
  if (t != n) return 0;
  for (int i = 0; i < n; i++) {
    t1[linker[i]] = i;
    g[linker[i]][i] = 0;
  }
  t = hungary();
  if (t != n) return 0;
  for (int i = 0; i < n; i++) t2[i] = linker[i];
  return 1;
}
int vis[N];
int main() {
  init();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  ans = getans();
  if (ans) {
    ans = 0;
    for (int i = 0; i < n; i++)
      if (!vis[i]) {
        vis[i] = 1;
        ans++;
        aa[ans].push_back(v0[i]);
        aa[ans].push_back(v1[t1[i]]);
        for (int j = t2[t1[i]]; j != i; j = t2[t1[j]]) {
          vis[j] = 1;
          aa[ans].push_back(v0[j]);
          aa[ans].push_back(v1[t1[j]]);
        }
      }
    printf("%d\n", ans);
    for (int i = 1; i <= ans; i++) {
      printf("%d", aa[i].size());
      for (int j = 0; j < aa[i].size(); j++) printf(" %d", aa[i][j]);
      puts("");
    }
  } else
    puts("Impossible");
  return 0;
}
