#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, m, k, i, j;
  cin >> n;
  int *a = new int[n];
  int N = 2000000;
  int *p = new int[N];
  for (i = 3; i < N; i += 2) p[i] = 1;
  for (i = 3; i < N; i += 2)
    if (p[i]) {
      k = i * i;
      if (k >= N) break;
      int i2 = i + i;
      for (j = k; j < N; j += i2) p[j] = 0;
    }
  set<int> primes;
  primes.insert(2);
  for (i = 3; i < N; i += 2)
    if (p[i]) primes.insert(i);
  int n1 = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) n1++;
  }
  if (n1 < 2) {
    for (i = 0; i < n; i++)
      for (j = i + 1; j < n; j++)
        if (primes.count(a[i] + a[j])) {
          cout << 2 << endl;
          cout << a[i] << " " << a[j] << endl;
          return 0;
        }
    cout << 1 << endl;
    cout << a[0] << endl;
    return 0;
  }
  j = -1;
  for (i = 0; i < n; i++) {
    if (a[i] == 1) continue;
    if (primes.count(a[i] + 1)) {
      j = a[i];
      break;
    }
  }
  if (j > 0)
    cout << n1 + 1 << endl << j << " ";
  else
    cout << n1 << endl;
  for (i = 0; i < n1; i++) cout << 1 << " ";
  cout << endl;
}
