#include <bits/stdc++.h>
using namespace std;
bool prime[30000005];
int main() {
  fill(prime, prime + 30000005, 1);
  for (int i = 2; i < 30000005; i++) {
    if (prime[i]) {
      for (int j = 2 * i; j < 30000005; j += i) {
        prime[j] = 0;
      }
    }
  }
  long long n;
  cin >> n;
  long long a[n], ans = 0, ai = -1;
  bool scs = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1)
      ans++;
    else {
      if (prime[a[i] + 1] && !scs) {
        ai = i;
        ans++;
        scs = 1;
      }
    }
  }
  ans = max(ans, 1ll);
  if (ans < 2) {
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (prime[a[i] + a[j]]) {
          cout << 2 << '\n' << a[i] << ' ' << a[j];
          return 0;
        }
      }
    }
  }
  cout << ans << '\n';
  if (ans == 1)
    cout << a[0];
  else {
    for (int i = 0; i < ans - 1; i++) {
      cout << 1 << ' ';
    }
    if (ai != -1)
      cout << a[ai];
    else
      cout << 1;
  }
  return 0;
}
