#include <bits/stdc++.h>
using namespace std;
int sushu[2000005];
vector<int> v1, v2;
void shai() {
  memset(sushu, -1, sizeof(sushu));
  for (int i = 2; i <= sqrt(2000005); i++) {
    if (sushu[i] == 0) continue;
    for (int j = 2;; j++) {
      if (i * j > 2000005) break;
      sushu[i * j] = 0;
    }
  }
}
int main() {
  shai();
  int n, x;
  cin >> n;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (x == 1) sum++;
    if (x % 2)
      v1.push_back(x);
    else
      v2.push_back(x);
  }
  if (v1.size() == 0) {
    printf("1\n%d\n", v2[0]);
    return 0;
  }
  if (v2.size() == 0 && sum <= 1) {
    printf("1\n%d\n", v1[0]);
    return 0;
  }
  int ff = 0;
  if (sum == 0 || sum == 1) {
    for (int i = 0; i < v1.size(); i++) {
      for (int j = 0; j < v2.size(); j++) {
        if (sushu[v1[i] + v2[j]] == -1) {
          printf("2\n%d %d\n", v1[i], v2[j]);
          ff = 1;
          return 0;
        }
      }
    }
    if (ff == 0) {
      for (int i = 0; i < v1.size(); i++) {
        printf("1\n%d\n", v1[i]);
        return 0;
      }
      for (int i = 0; i < v2.size(); i++) {
        printf("1\n%d\n", v2[i]);
        return 0;
      }
    }
  }
  int flag = 0;
  if (sum >= 1 && v2.size() > 0) {
    for (int j = 0; j < v2.size(); j++) {
      if (sushu[1 + v2[j]] == -1) {
        flag = v2[j];
        break;
      }
    }
  }
  if (flag == 0) {
    printf("%d\n1", sum);
    for (int i = 1; i < sum; i++) printf(" 1");
    printf("\n");
  } else {
    printf("%d\n1", sum + 1);
    for (int i = 1; i < sum; i++) printf(" 1");
    printf(" %d\n", flag);
  }
  return 0;
}
