#include <bits/stdc++.h>
using namespace std;
vector<int> tab;
int n, x, i;
bool z[2000010];
bool prim(int x) {
  if (z[x]) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int a = 2; a * a <= 2000000; a++) {
    if (!z[a])
      for (int b = a + a; b <= 2000000; b += a) z[b] = 1;
  }
  for (int a = 1; a <= n; a++) {
    cin >> x;
    if (x == 1) i++;
    tab.push_back(x);
  }
  if (i) {
    for (int a = 0; a < tab.size(); a++) {
      if (tab[a] != 1 && prim(tab[a] + 1)) {
        cout << i + 1 << "\n";
        for (int b = 1; b <= i; b++) cout << 1 << " ";
        cout << tab[a];
        return 0;
      }
    }
    if (i > 1) {
      cout << i << "\n";
      for (int a = 1; a <= i; a++) cout << 1 << " ";
      return 0;
    }
  }
  for (int a = 1; a <= n; a++) {
    for (int b = a + 1; b <= n; b++) {
      if (prim(tab[a - 1] + tab[b - 1])) {
        cout << 2 << "\n";
        cout << tab[a - 1] << " " << tab[b - 1] << "\n";
        return 0;
      }
    }
  }
  for (int a = 1; a <= n; a++) {
    cout << 1 << "\n";
    cout << tab[a - 1] << "\n";
    return 0;
  }
  cout << i << "\n";
  for (int a = 1; a <= i; a++) cout << 1 << " ";
  return 0;
}
