#include <bits/stdc++.h>
const int N = 2000001;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  int one = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    one += a[i] == 1;
  }
  bool pr[N];
  memset(pr, true, sizeof pr);
  pr[0] = pr[1] = false;
  for (int i = 2; i < N; i++) {
    if (pr[i]) {
      for (int j = i + i; j < N; j += i) {
        pr[j] = false;
      }
    }
  }
  if (one >= 2) {
    for (int e : a) {
      if (e % 2 == 0 && pr[e + 1]) {
        cout << one + 1 << '\n';
        while (one--) {
          cout << "1 ";
        }
        cout << e;
        return 0;
      }
    }
    cout << one << '\n';
    while (one--) {
      cout << "1 ";
    }
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (pr[a[i] + a[j]]) {
        cout << "2\n" << a[i] << ' ' << a[j];
        return 0;
      }
    }
  }
  cout << "1\n" << a[0];
}
