#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
long long int arr[2000009], brr[2000009];
int main() {
  int test_case = 1;
  for (int cs = 1; cs <= test_case; cs++) {
    for (int i = 2; i <= 2000009 - 9; i++) {
      if (!arr[i]) {
        for (int j = i + i; j <= 2000009 - 9; j += i) arr[j] = 1;
      }
    }
    long long int n;
    scanf("%lld", &n);
    long long int a1 = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &brr[i]);
      if (brr[i] == 1) a1++;
    }
    if (a1) {
      long long int b1 = 0;
      for (int i = 1; i <= n; i++) {
        if (brr[i] != 1 && arr[brr[i] + 1] == 0) {
          b1 = brr[i];
          break;
        }
      }
      if ((b1 + a1) < 2) {
        for (int i = 1; i <= n; i++) {
          for (int j = i + 1; j <= n; j++) {
            if (arr[brr[i] + brr[j]] == 0) {
              printf("2\n%lld %lld\n", brr[i], brr[j]);
              return 0;
            }
          }
        }
      }
      if (b1)
        printf("%lld\n", a1 + 1);
      else
        printf("%lld\n", a1);
      if (b1) printf("%lld ", b1);
      while (a1--) printf("1 ");
      printf("\n");
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (arr[brr[i] + brr[j]] == 0) {
          printf("2\n%lld %lld\n", brr[i], brr[j]);
          return 0;
        }
      }
    }
    printf("1\n%lld\n", brr[1]);
  }
  return 0;
}
