#include <bits/stdc++.h>
const long long N = 3000006;
using namespace std;
const long long MOD = 1000000007LL;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T power(T x, T y, long long m = MOD) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1LL;
    x = (x * x) % m;
  }
  return ans % m;
}
long long prime[N];
long long a[N], f[N];
int32_t main() {
  memset(prime, 1, sizeof(prime));
  prime[1] = 0;
  for (long long i = 2; i < N; i++) {
    if (!prime[i]) continue;
    for (long long j = i * i; j < N; j += i) prime[j] = 0;
  }
  long long n;
  cin >> n;
  for (long long(i) = (0); i < (n); i++) {
    cin >> a[i];
    ++f[a[i]];
  }
  long long maxi = 0;
  if (n == 1) {
    cout << "1" << '\n';
    cout << a[0];
    return 0;
  }
  for (long long(i) = (0); i < (n); i++) {
    if (a[i] == 1) continue;
    if (prime[a[i] + 1] && f[1]) {
      cout << f[1] + 1 << '\n';
      for (long long(i) = (0); i < (f[1]); i++) cout << "1 ";
      cout << a[i];
      return 0;
    }
  }
  if (f[1] >= 2) {
    cout << f[1] << '\n';
    for (long long(i) = (0); i < (f[1]); i++) cout << "1 ";
    return 0;
  }
  for (long long(i) = (0); i < (n - 1); i++) {
    for (long long(j) = (i + 1); j < (n); j++) {
      if (prime[a[i] + a[j]]) {
        cout << "2" << '\n';
        cout << a[i] << " " << a[j];
        return 0;
      }
    }
  }
  cout << "1" << '\n';
  cout << a[0];
}
