#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6;
int a[maxn];
bool tub[maxn + 1];
int main() {
  for (int i = 2; i * i <= maxn; i++) {
    if (!tub[i]) {
      for (int j = i * i; j <= maxn; j += i) tub[j] = 1;
    }
  }
  int n;
  cin >> n;
  int ans = 0, ans1 = 1, ans_x = a[0];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) ans++;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (!tub[a[i] + a[j]]) {
        if (ans < 2) {
          cout << 2 << endl;
          cout << a[i] << " " << a[j];
          return 0;
        }
      }
    }
  }
  if (ans > 0) {
    int ok = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] != 1 && !tub[a[i] + 1]) {
        ok = a[i];
        break;
      }
    }
    if (ok) {
      cout << ans + 1 << endl;
      for (int i = 1; i <= ans; i++) cout << 1 << " ";
      cout << ok;
    } else {
      cout << ans << endl;
      for (int i = 1; i <= ans; i++) cout << 1 << " ";
    }
  } else {
    cout << 1 << endl << a[1];
  }
}
