#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const long long xx = 2e6;
const long long MOD = 1e9 + 7;
long long prime[xx + 10];
void sieve() {
  prime[1] = 1;
  for (long long i = 2; i * i <= xx; i++) {
    if (prime[i] == 1) continue;
    for (long long j = i * i; j <= xx; j += i) {
      prime[j] = 1;
    }
  }
}
void pnt(long long x) {
  for (long long i = 0; i < x; i++) {
    cout << "1 ";
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  sieve();
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long one = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == 1) {
      one++;
    }
  }
  long long pl1 = -1;
  for (long long i = 0; i < n; i++) {
    if (prime[a[i] + 1] == 0 && a[i] != 1) {
      pl1 = a[i];
      break;
    }
  }
  if (one > 0 && pl1 > 0) {
    cout << one + 1 << '\n';
    pnt(one);
    cout << pl1;
  } else if (one > 1) {
    cout << one << '\n';
    pnt(one);
  } else {
    bool ok = false;
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < n; j++) {
        if (i != j) {
          if (prime[a[i] + a[j]] == 0) {
            debug() << "\033[94m ["
                    << "a[i]"
                       ": "
                    << (a[i])
                    << "]\033[0m"
                       "\033[94m ["
                    << "a[j]"
                       ": "
                    << (a[j]) << "]\033[0m";
            cout << 2 << '\n';
            cout << a[i] << " " << a[j];
            ok = true;
            break;
          }
        }
      }
      if (ok) break;
    }
    debug() << "\033[94m ["
            << "ok"
               ": "
            << (ok) << "]\033[0m";
    if (ok == false) {
      for (long long i = 0; i < n; i++) {
        if (prime[a[i]] == 0) {
          cout << 1 << '\n';
          cout << a[i];
          return 0;
        }
      }
    }
    if (ok == false) cout << 1 << '\n' << a[0];
  }
  cout << '\n';
}
