#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 666;
const long long INF = 1e18;
struct Edge {
  long long cap, f, to, idx;
  Edge(const long long &x, const long long &i, const long long &c,
       const long long &flow) {
    cap = c;
    f = flow;
    to = x;
    idx = i;
  }
};
long long p[MAXN];
long long d[MAXN];
long long n, s, t;
vector<Edge> g[MAXN];
bool bfs() {
  fill(d, d + MAXN, INF);
  d[s] = 0;
  queue<long long> q;
  q.push(s);
  while (!q.empty()) {
    long long v = q.front();
    q.pop();
    for (auto e : g[v]) {
      if (e.cap > e.f && d[e.to] == INF) {
        d[e.to] = d[v] + 1;
        q.push(e.to);
      }
    }
  }
  return (d[t] != INF);
}
long long dfs(const long long &v, const long long &minC) {
  if (v == t || minC == 0) {
    return minC;
  }
  for (long long i = p[v]; i < g[v].size(); ++i) {
    auto &e = g[v][i];
    if (d[e.to] == d[v] + 1) {
      long long delta = dfs(e.to, min(minC, e.cap - e.f));
      if (delta) {
        e.f += delta;
        g[e.to][e.idx].f -= delta;
        return delta;
      }
    }
    ++p[v];
  }
  return 0;
}
long long find_max_flow() {
  long long max_flow = 0;
  while (bfs()) {
    fill(p, p + MAXN, 0);
    long long flow = dfs(s, INF);
    while (flow) {
      max_flow += flow;
      flow = dfs(s, INF);
    }
  }
  return max_flow;
}
bool prime(long long x) {
  for (long long i = 2; i * i <= x; ++i)
    if (x % i == 0) return false;
  return true;
}
vector<long long> new_g[MAXN];
vector<long long> table;
long long colored[MAXN];
void unite(const long long &v, const long long &c) {
  colored[v] = c;
  table.emplace_back(v);
  for (auto to : new_g[v]) {
    if (!colored[to]) {
      unite(to, c);
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(15);
  cin >> n;
  vector<long long> a(n + 1);
  for (long long i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; ++i) {
    if (a[i] % 2 == 1) continue;
    for (long long j = 1; j <= n; ++j) {
      if (a[j] % 2 == 0) continue;
      if (prime(a[i] + a[j])) {
        long long idx = g[i].size();
        long long idxr = g[n + j].size();
        g[i].emplace_back(n + j, idxr, 1, 0);
        g[n + j].emplace_back(i, idx, 0, 0);
      }
    }
  }
  for (long long i = 1; i <= n; ++i) {
    long long idx = g[0].size();
    long long idxr = g[i].size();
    g[0].emplace_back(i, idxr, 2, 0);
    g[i].emplace_back(0, idx, 0, 0);
    idx = g[2 * n + 1].size();
    idxr = g[n + i].size();
    g[n + i].emplace_back(2 * n + 1, idx, 2, 0);
    g[2 * n + 1].emplace_back(n + i, idxr, 0, 0);
  }
  s = 0, t = 2 * n + 1;
  long long maxflow = find_max_flow();
  if (maxflow == n) {
    for (long long i = 1; i <= n; ++i) {
      for (auto e : g[i]) {
        if (e.f != 1) continue;
        new_g[i].emplace_back(e.to - n);
        new_g[e.to - n].emplace_back(i);
      }
    }
    long long c = 0;
    vector<vector<long long>> ans;
    for (long long i = 1; i <= n; ++i) {
      if (!colored[i]) {
        table.clear();
        unite(i, ++c);
        ans.emplace_back(table);
      }
    }
    cout << ans.size() << '\n';
    for (auto &v : ans) {
      cout << v.size() << ' ';
      for (auto x : v) cout << x << ' ';
      cout << '\n';
    }
  } else {
    cout << "Impossible";
  }
  return 0;
}
