#include <bits/stdc++.h>
using namespace std;
long long prime[2000006];
int main() {
  long long i, j;
  prime[1] = 1;
  for (i = 2; i < 2000006; i++) {
    for (j = 2 * i; j < 2000006; j += i) prime[j] = 1;
  }
  long long n;
  cin >> n;
  long long a[n], co = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) co++;
  }
  if (co > 1) {
    for (i = 0; i < n; i++) {
      if (prime[a[i] + 1] == 0 && a[i] > 1) {
        cout << co + 1 << endl << a[i] << " ";
        for (j = 0; j < co; j++) cout << 1 << " ";
        return 0;
      }
    }
    cout << co << endl;
    for (i = 0; i < co; i++) cout << 1 << " ";
    return 0;
  }
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (prime[a[i] + a[j]] == 0) {
        cout << 2 << endl;
        cout << a[i] << " " << a[j];
        return 0;
      }
    }
  }
  cout << 1 << endl << a[0];
  return 0;
}
