#include <bits/stdc++.h>
using namespace std;
const long long N = 2e6 + 4;
long long pf[N];
void fun() {
  for (long long i = 0; i < N; i++) pf[i] = i;
  for (long long i = 2; i * i < N; i++) {
    if (pf[i] == i) {
      for (long long j = i; j < N; j += i) {
        if (pf[j] == j) pf[j] = i;
      }
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(20) << fixed;
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  fun();
  long long c = 0;
  for (long long i = 0; i < n; i++)
    if (a[i] == 1) c++;
  if (c > 1) {
    for (long long i = 0; i < n; i++) {
      if (pf[a[i] + 1] == a[i] + 1 && a[i] != 1) {
        cout << c + 1 << endl;
        for (long long i = 0; i < c; i++) cout << 1 << " ";
        cout << a[i] << endl;
        return 0;
      }
    }
    cout << c << endl;
    for (long long i = 0; i < c; i++) cout << 1 << " ";
    cout << endl;
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (pf[a[i] + a[j]] == a[i] + a[j]) {
        cout << 2 << endl;
        cout << a[i] << " " << a[j] << endl;
        return 0;
      }
    }
  }
  cout << 1 << endl;
  cout << a[0] << endl;
  return 0;
}
