#include <bits/stdc++.h>   using namespace std;   template <class T>   bool isPrime(T x) {     if (x <= 1) return false;     T i;     for (i = 2; i * i <= x; i++)       if (x % i == 0) return false;     return true;   }   template <class T>   class Prime {    public:     vector<T> z;     Prime() {       z.resize(1e5 + 7);       for (int i = (0); i < (((int)z.size())); i++) z[i] = 1;       z[0] = 0;       z[1] = 0;       T j;       for (int i = (2); i < (((int)z.size())); i++) {         if (z[i]) {           j = i + i;           while (j < ((int)z.size())) {             z[j] = 0;             j += i;           }         }       }     }   };   template <class T>   double dist(T x1, T y1, T x2, T y2) {     return sqrt(1. * (x2 - x1) * (x2 - x1) + 1. * (y2 - y1) * (y2 - y1));   }   template <class T>   class Point {    public:     T x, y;     Point() {}     Point(T a, T b) : x(a), y(b) {}     bool operator==(const Point& tmp) const { return (x == tmp.x && y == tmp.y); }     Point operator-(const Point& tmp) const {       return Point<T>(x - tmp.x, y - tmp.y);     }   };   char toLowerCase(char x) { return (x + 32); }   char toUpperCase(char x) { return (x - 32); }   bool isUpperCase(char x) { return (65 <= x && x <= 90) ? 1 : 0; }   bool isLowerCase(char x) { return (97 <= x && x <= 122) ? 1 : 0; }   bool isAlpha(char x) { return (isUpperCase(x) || isLowerCase(x)) ? 1 : 0; }   bool isDigit(char x) { return ( 0  <= x && x <=  9 ) ? 1 : 0; }   template <class T>   T toDec(string s) {     stringstream is(s);     T res;     is >> res;     return res;   }   template <class T>   string toStr(T n) {     string s;     stringstream is;     is << n;     is >> s;     return s;   }   template <class T>   void checkmin(T& a, T b) {     if (a > b) a = b;   }   template <class T>   void checkmax(T& a, T b) {     if (a < b) a = b;   }   vector<vector<int> > g, ans, ng;   vector<int> visited, parent;   bool bfs(int s, int t) {     visited = vector<int>(s + 5, 0);     parent = vector<int>(s + 5, -1);     queue<int> q;     q.push(s);     visited[s] = 1;     int u;     while (!q.empty()) {       u = q.front();       q.pop();       if (u == t) return true;       for (int v = 0; v < s + 5; v++) {         if (g[u][v] > 0 && !visited[v]) {           q.push(v);           parent[v] = u;           visited[v] = 1;         }       }     }     return false;   }   int getMaxFlow(int n) {     int max_flow = 0;     int path_min = 1e9;     int u, v;     while (bfs(n, n + 1)) {       for (v = n + 1; v != n; v = parent[v]) {         u = parent[v];         path_min = min(path_min, g[u][v]);       }       for (v = n + 1; v != n; v = parent[v]) {         u = parent[v];         g[u][v] -= path_min;         g[v][u] += path_min;       }       max_flow += path_min;     }     return max_flow;   }   int main() {     int n;     cin >> n;     g = vector<vector<int> >(n + 5, vector<int>(n + 5, 0));     vector<int> a(n + 5, 0);     for (int i = 0; i < n; i++) {       cin >> a[i];       if (a[i] % 2 == 0)         g[n][i] = 2;       else         g[i][n + 1] = 2;     }     for (int i = 0; i < n; i++) {       if (a[i] % 2 == 0) {         for (int j = 0; j < n; j++) {           if (isPrime<int>(a[i] + a[j])) {             g[i][j] = 1;           }         }       }     }     if (getMaxFlow(n) != n)       cout <<  Impossible ;     else {       ng = vector<vector<int> >(n + 5);       for (int i = 0; i < n; i++) {         if (a[i] % 2) {           for (int j = 0; j < n; j++) {             if (g[i][j]) {               ng[i].push_back(j);               ng[j].push_back(i);             }           }         }       }       visited = vector<int>(n + 5);       int node, prev, tmp;       for (int i = 0; i < n; i++) {         if (visited[i]) continue;         visited[i] = 1;         prev = i;         node = ng[i][0];         vector<int> res;         res.push_back(i);         while (node != i) {           visited[node] = 1;           res.push_back(node);           tmp = node;           node = (prev != ng[node][0] ? ng[node][0] : ng[node][1]);           prev = tmp;         }         ans.push_back(res);       }       cout << ((int)ans.size()) <<   n ;       for (int i = 0; i < ((int)ans.size()); i++) {         cout << ((int)ans[i].size()) <<    ;         for (int j = 0; j < ((int)ans[i].size()); j++) {           if (j) cout <<    ;           cout << ans[i][j] + 1;         }         cout <<   n ;       }     }     return 0;   }