#include <bits/stdc++.h>
using namespace std;
bool prime[2000006];
int ara[1003];
void sieve() {
  for (int i = 2; i <= 2000000; i++)
    if (!prime[i]) {
      for (int j = 2 * i; j <= 2000000; j += i) prime[j] = 1;
    }
  return;
}
int main() {
  sieve();
  int n, o = 0, t = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &ara[i]), o += (ara[i] == 1);
    if (ara[i] != 1 && !prime[ara[i] + 1]) t = ara[i];
  }
  if (o && t) {
    printf("%d\n", o + 1);
    for (int i = 0; i < o; i++) printf("1 ");
    printf("%d\n", t);
  } else if (o > 1) {
    printf("%d\n", o);
    for (int i = 0; i < o; i++) printf("1 ");
    puts("");
  } else {
    int a = -1, b = -1;
    for (int i = 0; i < n - 1 && a == -1; i++)
      for (int j = i + 1; j < n && a == -1; j++)
        if (!prime[ara[i] + ara[j]]) a = ara[i], b = ara[j];
    if (a == -1)
      printf("1\n%d\n", ara[0]);
    else
      printf("2\n%d %d\n", a, b);
  }
  return 0;
}
