#include <bits/stdc++.h>
using namespace std;
vector<bool> erato(int n) {
  vector<bool> numbers(n + 1, true);
  numbers[0] = false;
  numbers[1] = false;
  for (int i = 2; i * i <= n; ++i) {
    if (numbers[i]) {
      for (int j = i * i; j <= n; j += i) {
        numbers[j] = false;
      }
    }
  }
  return numbers;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int a;
  cin >> a;
  vector<bool> prime = erato(2000010);
  vector<int> ans1;
  vector<int> ans2;
  vector<int> num(a);
  for (int i = 0; i < a; ++i) {
    cin >> num[i];
  }
  for (int i = 0; i < a - 1; ++i) {
    if (ans1.size() == 2) {
      break;
    }
    for (int j = i + 1; j < a; ++j) {
      if (prime[num[i] + num[j]]) {
        ans1.push_back(num[i]);
        ans1.push_back(num[j]);
        break;
      }
    }
  }
  bool flag = false;
  for (int i = 0; i < a; ++i) {
    if (num[i] == 1) {
      ans2.push_back(num[i]);
    } else if (prime[num[i] + 1] && !flag) {
      ans2.push_back(num[i]);
      flag = true;
    }
  }
  if (ans2.size() > 2) {
    cout << ans2.size() << "\n";
    for (int i = 0; i < ans2.size(); ++i) cout << ans2[i] << " ";
  } else if (ans1.size() == 2) {
    cout << "2"
         << "\n"
         << ans1[0] << " " << ans1[1];
  } else {
    cout << 1 << "\n" << num[0];
  }
  return 0;
}
