#include <bits/stdc++.h>
using namespace std;
int n, i, a[11111], k, j, r, p[3333];
bool Prost(int q) {
  for (int j = 0; j < r; j++) {
    if (!(q % p[j]) && q != p[j]) return 0;
    if (p[j] * p[j] > q) break;
  }
  return 1;
}
int main() {
  for (i = 2; i <= sqrt(2000000); i++)
    if (Prost(i)) {
      p[r] = i;
      r++;
    }
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  if (a[0] == 1 && a[1] == 1) {
    i = 0;
    while (a[i] == 1) {
      i++;
      k++;
    }
    for (; i < n; i++) {
      if (Prost(a[i] + 1)) {
        cout << k + 1 << endl;
        cout << a[i] << " ";
        for (i = 0; i < k; i++) cout << 1 << " ";
        return 0;
      }
    }
    cout << k << endl;
    for (i = 0; i < k; i++) cout << 1 << " ";
    return 0;
  } else {
    for (i = 0; i < n; i++)
      for (j = i + 1; j < n; j++)
        if (Prost(a[i] + a[j])) {
          cout << 2 << endl;
          cout << a[i] << " " << a[j];
          return 0;
        }
    cout << 1 << endl << a[0];
  }
  return 0;
}
