#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e4 + 9, N = 2e6 + 9;
int n, a[MAX], pr[N], s, a1, a2;
int main() {
  pr[1] = 1;
  for (int i = 1; i < N; i++)
    if (!pr[i])
      for (int j = i * 2; j < N; j += i) pr[j] = 1;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], s += (a[i] == 1);
  for (int i = 0; i < n; i++) {
    if (!pr[a[i] + 1] && s && a[i] != 1) {
      cout << s + 1 << '\n';
      for (int i = 0; i < s; i++) cout << 1 << ' ';
      cout << a[i] << '\n';
      return 0;
    }
    for (int j = i + 1; j < n; j++)
      if (!pr[a[i] + a[j]]) a1 = a[i], a2 = a[j];
  }
  if (s > 2) {
    cout << s << '\n';
    for (int i = 0; i < s; i++) cout << 1 << ' ';
    return 0;
  }
  if (a1) return cout << 2 << '\n' << a1 << " " << a2, 0;
  cout << 1 << '\n' << a[0];
}
