#include <bits/stdc++.h>
using namespace std;
bool judge(int p) {
  for (int i = 2; i * i <= p; i++)
    if (p % i == 0) return 0;
  return 1;
}
int a[1010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  if (a[1] != 1) {
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (judge(a[i] + a[j])) {
          printf("2\n");
          printf("%d %d\n", a[i], a[j]);
          return 0;
        }
      }
    }
    printf("1\n");
    printf("%d\n", a[1]);
    return 0;
  }
  int pos = 1;
  while (pos <= n && a[pos] == 1) pos++;
  pos--;
  for (int i = pos + 1; i <= n; i++) {
    if (judge(a[i] + 1)) {
      printf("%d\n", pos + 1);
      for (int i = 1; i <= pos; i++) printf("1 ");
      printf("%d\n", a[i]);
      return 0;
    }
  }
  if (pos >= 2) {
    printf("%d\n", pos);
    for (int i = 1; i <= pos; i++) printf("1 ");
    printf("\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (judge(a[i] + a[j])) {
        printf("2\n");
        printf("%d %d\n", a[i], a[j]);
        return 0;
      }
    }
  }
  printf("1\n");
  printf("%d\n", a[1]);
  return 0;
}
