#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
const int MM = 998244353;
const long double PI = acos(-1);
long long power(long long b, long long e, long long m) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b % m, e / 2, m) % m;
  return power(b * b % m, e / 2, m);
}
long long power(long long b, long long e) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b, e / 2);
  return power(b * b, e / 2);
}
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  return os << '(' << p.first << "," << p.second << ')';
}
const int N = 1000005;
bool prime[N];
long long pf[N];
void sieve() {
  int k = sqrt(N - 2);
  for (int i = 1; i <= N - 2; ++i) prime[i] = true;
  for (int i = 2; i <= k; ++i) {
    if (prime[i]) {
      for (int k = i * i; k <= N - 2; k += i) {
        prime[k] = false;
        pf[k] = i;
      }
    }
  }
}
template <typename flow_t = long long>
struct Dinic {
  struct FlowEdge {
    int v, u;
    flow_t cap, flow = 0;
    FlowEdge(int v, int u, flow_t cap) : v(v), u(u), cap(cap) {}
  };
  const flow_t flow_inf = numeric_limits<flow_t>::max() / 2;
  vector<FlowEdge> edges;
  vector<vector<int>> adj;
  int n, m = 0;
  int s, t;
  vector<int> level, ptr;
  queue<int> q;
  Dinic(int n, int s, int t) : n(n), s(s), t(t) {
    adj.resize(n + 1);
    level.resize(n + 1);
    ptr.resize(n + 1);
  }
  void add_edge(int v, int u, flow_t cap) {
    edges.emplace_back(v, u, cap);
    edges.emplace_back(u, v, 0);
    adj[v].push_back(m);
    adj[u].push_back(m + 1);
    m += 2;
  }
  bool bfs() {
    while (!q.empty()) {
      int v = q.front();
      q.pop();
      for (int id : adj[v]) {
        if (edges[id].cap - edges[id].flow < 1) continue;
        if (level[edges[id].u] != -1) continue;
        level[edges[id].u] = level[v] + 1;
        q.push(edges[id].u);
      }
    }
    return level[t] != -1;
  }
  flow_t dfs(int v, flow_t pushed) {
    if (pushed == 0) return 0;
    if (v == t) return pushed;
    for (int &cid = ptr[v]; cid < (int)adj[v].size(); cid++) {
      int id = adj[v][cid];
      int u = edges[id].u;
      if (level[v] + 1 != level[u] || edges[id].cap - edges[id].flow < 1)
        continue;
      flow_t tr = dfs(u, min(pushed, edges[id].cap - edges[id].flow));
      if (tr == 0) continue;
      edges[id].flow += tr;
      edges[id ^ 1].flow -= tr;
      return tr;
    }
    return 0;
  }
  flow_t flow() {
    flow_t f = 0;
    while (true) {
      fill(level.begin(), level.end(), -1);
      level[s] = 0;
      q.push(s);
      if (!bfs()) break;
      fill(ptr.begin(), ptr.end(), 0);
      while (flow_t pushed = dfs(s, flow_inf)) {
        f += pushed;
      }
    }
    return f;
  }
};
bitset<201> vis;
vector<int> g[201];
void dfs(int s, vector<int> &u) {
  u.push_back(s);
  vis[s] = true;
  for (auto &j : g[s]) {
    if (!vis[j]) dfs(j, u);
  }
}
int _runtimeTerror_() {
  int n;
  cin >> n;
  vector<int> v(n + 1);
  for (int i = 1; i <= n; ++i) cin >> v[i];
  Dinic<int> flow(n + 2, 0, n + 1);
  vector<int> cnt(2, 0);
  for (int i = 1; i <= n; ++i) {
    ++cnt[v[i] & 1];
    if (v[i] & 1)
      flow.add_edge(0, i, 2);
    else
      flow.add_edge(i, n + 1, 2);
    for (int j = 1; j <= n; ++j) {
      if (v[i] % 2 == 1 && v[j] % 2 == 0 && prime[v[i] + v[j]])
        flow.add_edge(i, j, 1);
    }
  }
  if (cnt[0] != cnt[1]) {
    cout << "Impossible\n";
    return 0;
  }
  int ans = flow.flow();
  if (ans == 2 * cnt[0]) {
    for (auto &k : flow.edges) {
      if (k.flow == 1) g[k.v].push_back(k.u), g[k.u].push_back(k.v);
    }
    vector<vector<int>> ans;
    for (int i = 1; i <= n; ++i) {
      if (!vis[i]) {
        vector<int> u;
        dfs(i, u);
        ans.push_back(u);
      }
    }
    cout << (long long)ans.size() << "\n";
    for (auto &j : ans) {
      cout << (long long)j.size() << " ";
      for (auto &k : j) cout << k << " ";
      cout << "\n";
    }
  } else {
    cout << "Impossible\n";
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  sieve();
  int TESTS = 1;
  while (TESTS--) _runtimeTerror_();
  return 0;
}
