#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline void chmin(T &t, U f) {
  if (t > f) t = f;
}
template <class T, class U>
inline void chmax(T &t, U f) {
  if (t < f) t = f;
}
bool f[2222222];
map<long long, long long> cnt;
signed main() {
  fill_n(f, 2222222, true);
  f[0] = f[1] = false;
  for (long long i = 2; i < 2222222; i++) {
    if (!f[i]) continue;
    for (long long j = i * 2; j < 2222222; j += i) f[j] = false;
  }
  long long N;
  cin >> N;
  for (long long i = 0; i < (long long)(N); i++) {
    long long a;
    cin >> a;
    cnt[a]++;
  }
  for (__typeof((cnt).begin()) it = (cnt).begin(); it != (cnt).end(); it++) {
    if (!f[it->first * 2]) {
      it->second = 1;
    }
  }
  pair<long long, long long> u, v;
  for (__typeof((cnt).begin()) i = (cnt).begin(); i != (cnt).end(); i++) {
    for (__typeof((cnt).begin()) j = (cnt).begin(); j != (cnt).end(); j++) {
      if (i->first == j->first) {
        if (u.second + v.second < i->second) {
          u = *i;
          v = pair<long long, long long>(0, 0);
        }
      } else if (u.second + v.second < i->second + j->second &&
                 f[i->first + j->first]) {
        u = *i;
        v = *j;
      }
    }
  }
  cout << u.second + v.second << endl;
  for (long long i = 0; i < (long long)(u.second); i++) cout << u.first << " ";
  for (long long i = 0; i < (long long)(v.second); i++) cout << v.first << " ";
  cout << endl;
  return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

A tuple of positive integers {x1, x2, ..., xk} is called simple if for all pairs of positive integers (i, j) (1 ≤ i < j ≤ k), xi + xj is a prime.

You are given an array a with n positive integers a1, a2, ..., an (not necessary distinct). You want to find a simple subset of the array a with the maximum size.

A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.

Let's define a subset of the array a as a tuple that can be obtained from a by removing some (possibly all) elements of it.

Input

The first line contains integer n (1 ≤ n ≤ 1000) — the number of integers in the array a.

The second line contains n integers ai (1 ≤ ai ≤ 106) — the elements of the array a.

Output

On the first line print integer m — the maximum possible size of simple subset of a.

On the second line print m integers bl — the elements of the simple subset of the array a with the maximum size.

If there is more than one solution you can print any of them. You can print the elements of the subset in any order.

Examples

Input

2
2 3


Output

2
3 2


Input

2
2 2


Output

1
2


Input

3
2 1 1


Output

3
1 1 2


Input

2
83 14


Output

2
14 83

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline void chmin(T &t, U f) {
  if (t > f) t = f;
}
template <class T, class U>
inline void chmax(T &t, U f) {
  if (t < f) t = f;
}
bool f[2222222];
map<long long, long long> cnt;
signed main() {
  fill_n(f, 2222222, true);
  f[0] = f[1] = false;
  for (long long i = 2; i < 2222222; i++) {
    if (!f[i]) continue;
    for (long long j = i * 2; j < 2222222; j += i) f[j] = false;
  }
  long long N;
  cin >> N;
  for (long long i = 0; i < (long long)(N); i++) {
    long long a;
    cin >> a;
    cnt[a]++;
  }
  for (__typeof((cnt).begin()) it = (cnt).begin(); it != (cnt).end(); it++) {
    if (!f[it->first * 2]) {
      it->second = 1;
    }
  }
  pair<long long, long long> u, v;
  for (__typeof((cnt).begin()) i = (cnt).begin(); i != (cnt).end(); i++) {
    for (__typeof((cnt).begin()) j = (cnt).begin(); j != (cnt).end(); j++) {
      if (i->first == j->first) {
        if (u.second + v.second < i->second) {
          u = *i;
          v = pair<long long, long long>(0, 0);
        }
      } else if (u.second + v.second < i->second + j->second &&
                 f[i->first + j->first]) {
        u = *i;
        v = *j;
      }
    }
  }
  cout << u.second + v.second << endl;
  for (long long i = 0; i < (long long)(u.second); i++) cout << u.first << " ";
  for (long long i = 0; i < (long long)(v.second); i++) cout << v.first << " ";
  cout << endl;
  return 0;
}

```