#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 a[N];
int p[M];
vector<int> v[N];
int vis[N];
vector<int> aa[N];
class Dinic {
 public:
  int d[N];
  int head[N], nxt[M], cur[N];
  struct Edge {
    int from, to, cap, flow;
    Edge(int from, int to, int cap, int flow)
        : from(from), to(to), cap(cap), flow(flow) {}
    Edge() {}
  } e[M];
  int s, t, cnt;
  int node;
  bool bfs() {
    for (int i = 0; i < node; i++) d[i] = -1;
    d[s] = 0;
    queue<int> q;
    q.push(s);
    while (!q.empty()) {
      int x = q.front();
      q.pop();
      for (int i = head[x]; ~i; i = nxt[i]) {
        Edge &ed = e[i];
        if (d[ed.to] == -1 && ed.cap > ed.flow) {
          d[ed.to] = d[x] + 1;
          q.push(ed.to);
        }
      }
    }
    return d[t] != -1;
  }
  int dfs(int x, int a) {
    if (x == t || a == 0) return a;
    int flow = 0, f;
    for (; ~cur[x]; cur[x] = nxt[cur[x]]) {
      Edge &ed = e[cur[x]];
      if (d[ed.to] == d[x] + 1 &&
          (f = dfs(ed.to, min(ed.cap - ed.flow, a))) > 0) {
        flow += f;
        ed.flow += f;
        e[cur[x] ^ 1].flow -= f;
        a -= f;
        if (a == 0) break;
      }
    }
    return flow;
  }
  void addEdge(int from, int to, int cap) {
    e[cnt] = Edge(from, to, cap, 0);
    int tmp = head[from];
    head[from] = cnt;
    nxt[cnt++] = tmp;
    e[cnt] = Edge(to, from, 0, 0);
    tmp = head[to];
    head[to] = cnt;
    nxt[cnt++] = tmp;
  }
  void init() { cnt = node = 0; }
  int maxFlow() {
    int flow = 0;
    while (bfs()) {
      for (int i = 0; i < node; i++) cur[i] = head[i];
      flow += dfs(s, inf);
    }
    return flow;
  }
  void buildGraph(int n) {
    memset(head, -1, sizeof(head));
    node = n + 1;
    s = node++, t = node++;
    for (int i = 1; i <= n; i++)
      if (a[i] & 1) {
        addEdge(s, i, 2);
        for (int j = 1; j <= n; j++)
          if (!p[a[i] + a[j]]) addEdge(i, j, 1);
      } else
        addEdge(i, t, 2);
  }
} dinic;
void init() {
  for (int i = 2; i < M; i++)
    for (int j = i + i; j < M; j += i) p[j] = 1;
}
int getans() {
  dinic.init();
  dinic.buildGraph(n);
  if (dinic.maxFlow() != n) return 0;
  for (int i = 0; i < dinic.cnt; i += 2) {
    int x = dinic.e[i].from, y = dinic.e[i].to;
    if (x <= n && y <= n && dinic.e[i].cap == dinic.e[i].flow) {
      v[x].push_back(y);
      v[y].push_back(x);
    }
  }
  int ret = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      ret++;
      aa[ret].push_back(i);
      vis[i] = 1;
      for (int j = v[i][0], last = i; j != i;) {
        aa[ret].push_back(j);
        vis[j] = 1;
        int t = v[j][0] == last;
        last = j;
        j = v[j][t];
      }
    }
  return ret;
}
int main() {
  init();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  ans = getans();
  if (ans) {
    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;
}
