#include <bits/stdc++.h>
using namespace std;
int n;
int a[1010];
bool p[2000000 + 10];
int cnt[2000000 + 10];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 2; i * i <= 2000000; i++)
    if (!p[i])
      for (int j = i + i; j <= 2000000; j += i) p[j] = 1;
  for (int i = 1; i <= n; i++) cnt[a[i]]++;
  if (cnt[1] >= 2) {
    for (int i = 1; i <= n; i++) {
      if (a[i] != 1 && !p[a[i] + 1]) {
        cout << cnt[1] + 1 << endl;
        for (int j = 1; j <= cnt[1]; j++) cout << "1 ";
        cout << a[i] << endl;
        return 0;
      }
    }
    cout << cnt[1] << endl;
    for (int i = 1; i <= cnt[1]; i++) cout << "1 ";
    cout << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) {
        if (!p[a[i] + a[j]]) {
          cout << 2 << endl;
          cout << a[i] << " " << a[j] << endl;
          return 0;
        }
      }
  cout << 1 << endl;
  cout << a[1] << endl;
  return 0;
}
