#include <bits/stdc++.h>
using namespace std;
const int N = 205;
const int INF = 0x3f3f3f3f;
struct Node {
  int to;
  int cap;
  int rev;
  Node(){};
  Node(int t, int c, int r) { to = t, cap = c, rev = r; }
};
vector<Node> v[N];
vector<int> ans;
bool used[N];
int f[N];
int num[205], sum;
bool isprime[20005], vis[205];
void add_Node(int from, int to, int cap) {
  v[from].push_back(Node(to, cap, v[to].size()));
  v[to].push_back(Node(from, 0, v[from].size() - 1));
}
int dfs(int s, int t, int f) {
  if (s == t) return f;
  used[s] = true;
  for (int i = 0; i < v[s].size(); i++) {
    Node &tmp = v[s][i];
    if (used[tmp.to] == false && tmp.cap > 0) {
      int d = dfs(tmp.to, t, min(f, tmp.cap));
      if (d > 0) {
        tmp.cap -= d;
        v[tmp.to][tmp.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}
int max_flow(int s, int t) {
  int flow = 0;
  for (;;) {
    memset(used, false, sizeof(used));
    int f = dfs(s, t, INF);
    if (f == 0) return flow;
    flow += f;
  }
}
void init(int n, int MAX) {
  for (int i = 1; i <= n; i++) f[i] = i;
  for (int i = 2; i <= 2 * MAX; i++)
    if (!isprime[i])
      for (int j = i + i; j <= 2 * MAX; j += i) isprime[j] = 1;
}
int find(int x) {
  if (f[x] != x) f[x] = find(f[x]);
  return f[x];
}
void Union(int a, int b) {
  int f1 = find(a);
  int f2 = find(b);
  if (f1 != f2) f[f2] = f1, sum--;
}
void dfs(int u, int p, int z, bool f, bool pri) {
  Node t;
  int to;
  for (int i = 0; i < v[u].size(); i++) {
    if (f == 1)
      t = v[u][i], to = t.to;
    else
      t = v[v[u][i].to][v[u][i].rev], to = v[u][i].to;
    if (t.cap == 1 && to != p) {
      if (to == z) return;
      Union(u, to);
      vis[to] = 1;
      if (pri) ans.push_back(to);
      dfs(to, u, z, f ^ 1, pri);
      return;
    }
  }
}
int main() {
  int n, MAX = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num[i]);
    MAX = max(MAX, num[i]);
  }
  init(n, MAX);
  if (n % 2 || n <= 2) {
    printf("Impossible\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (num[i] % 2) {
      add_Node(0, i, 2);
      for (int j = 1; j <= n; j++)
        if (num[j] % 2 == 0 && !isprime[num[i] + num[j]]) add_Node(i, j, 1);
    } else
      add_Node(i, n + 1, 2);
  }
  if (max_flow(0, n + 1) == n) {
    sum = n;
    Node t;
    for (int i = 0; i < v[n + 1].size(); i++) {
      t = v[n + 1][i];
      if (!vis[t.to]) {
        vis[t.to] = 1;
        dfs(t.to, -1, t.to, 1, 0);
      }
    }
    printf("%d\n", sum);
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < v[n + 1].size(); i++) {
      t = v[n + 1][i];
      if (!vis[t.to]) {
        ans.clear();
        ans.push_back(t.to);
        vis[t.to] = 1;
        dfs(t.to, -1, t.to, 1, 1);
        printf("%d", ans.size());
        for (int i = 0; i < ans.size(); i++) printf(" %d", ans[i]);
        printf("\n");
      }
    }
  } else
    printf("Impossible\n");
  return 0;
}
