#include <bits/stdc++.h>
using namespace std;
int read() {
  int res(0), sign(1);
  char c;
  while (1) {
    c = getchar();
    if ('0' <= c && c <= '9') {
      res = c - '0';
      break;
    } else if (c == '-') {
      sign = -1;
      break;
    }
  }
  while (1) {
    c = getchar();
    if ('0' <= c && c <= '9')
      res = res * 10 + c - '0';
    else
      break;
  }
  return res * sign;
}
vector<vector<int> > V;
vector<int> tmp;
pair<int, int> A[205];
int N, vis;
int visited[205];
int D[205][205], E[205][205];
bool prime(int a) {
  if (a == 2) return true;
  if (!(a & 1)) return false;
  for (int i = 3; i * i <= a; i += 2)
    if (!(a % i)) return false;
  return true;
}
int dfs(int x, int flow) {
  visited[x] = vis;
  if (x == N + 1) return flow;
  int i;
  for (i = 0; i <= N + 1; i++)
    if (visited[i] != vis && D[x][i]) {
      int t = dfs(i, min(D[x][i], flow));
      if (!t) continue;
      D[x][i] -= t;
      D[i][x] += t;
      return t;
    }
  return 0;
}
void dfs2(int x) {
  tmp.push_back(A[x].second);
  visited[x] = vis;
  int i;
  for (i = 1; i <= N; i++)
    if (visited[i] != vis && E[x][i]) dfs2(i);
}
int main() {
  int a, i, j, k(0), l;
  l = N = read();
  for (i = 1; i <= N; i++) {
    a = read();
    if (a & 1)
      A[++k] = make_pair(a, i);
    else
      A[l--] = make_pair(a, i);
  }
  for (i = 1; i <= N; i++)
    if (A[i].first & 1)
      D[0][i] = 2;
    else
      D[i][N + 1] = 2;
  for (i = 1; i <= k; i++)
    for (j = k + 1; j <= N; j++) D[i][j] = prime(A[i].first + A[j].first);
  int res(0), t(0);
  while (1) {
    vis++;
    t = dfs(0, 1000000000);
    if (!t) break;
    res += t;
  }
  if (res == 2 * k) {
    for (i = 1; i <= k; i++)
      for (j = k + 1; j <= N; j++)
        if (D[j][i]) E[i][j] = E[j][i] = true;
    vis++;
    for (i = 1; i <= N; i++)
      if (visited[i] != vis) {
        tmp.clear();
        dfs2(i);
        V.push_back(tmp);
        if (tmp.size() & 1) {
          printf("Impossible\n");
          return 0;
        }
      }
    vector<vector<int> >::iterator it;
    vector<int>::iterator it2;
    printf("%d\n", (int)V.size());
    for (it = V.begin(); it != V.end(); ++it) {
      printf("%d", (int)it->size());
      for (it2 = it->begin(); it2 != it->end(); ++it2) printf(" %d", *it2);
      printf("\n");
    }
  } else
    printf("Impossible\n");
  return 0;
}
