#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int M = 2e6 + 9;
int marked[(M >> 6) + 9];
vector<int> primes;
void sieve(int n) {
  memset(marked, 0, sizeof(marked));
  for (int i = 3; i * i <= n; i += 2)
    if (!(marked[i >> 6] & (1 << ((i >> 1) & 31))))
      for (int j = i * i; j <= n; j += (i + i))
        (marked[j >> 6] |= (1 << ((j >> 1) & 31)));
  primes.push_back(2);
  for (int i = 3; i <= n; i += 2)
    if (!(marked[i >> 6] & (1 << ((i >> 1) & 31)))) primes.push_back(i);
}
bool is_prime(int x) {
  if (x > 2 && x % 2 == 0) return false;
  if (x == 2 || !(marked[x >> 6] & (1 << ((x >> 1) & 31)))) return true;
  return false;
}
int n, one = 0, a[1001];
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  sieve(M);
  cin >> n;
  vector<int> ev, od;
  for (ll(i) = ll(0); (i) < (ll)(n); ++(i)) {
    cin >> a[i];
    if (a[i] == 1)
      one++;
    else if (a[i] & 1)
      od.push_back(a[i]);
    else
      ev.push_back(a[i]);
  }
  if (one > 1) {
    int ans = -1, xkxkx = 0;
    for (int i = 0; i < ev.size(); i++) {
      if (is_prime(1 + ev[i])) {
        ans = ev[i];
        xkxkx = 1;
        break;
      }
    }
    cout << one + xkxkx << '\n';
    for (ll(i) = ll(0); (i) < (ll)(one); ++(i)) cout << 1 << " ";
    if (ans > -1) cout << ans << '\n';
  } else {
    if (one == 1) od.push_back(1);
    int x = -1, y = -1, xkxkx = 0;
    for (int j = 0; j < od.size(); j++) {
      for (int i = 0; i < ev.size(); i++) {
        if (is_prime(od[j] + ev[i])) {
          x = ev[i];
          y = od[j];
          xkxkx = 2;
          break;
        }
      }
      if (x > -1 && y > -1) break;
    }
    if (xkxkx == 0) {
      cout << 1 << '\n' << a[0] << '\n';
    } else {
      cout << 2 << '\n' << x << " " << y << '\n';
    }
  }
}

### Prompt

Generate a cpp solution to the following problem:

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;
using ll = long long;
using pii = pair<int, int>;
const int M = 2e6 + 9;
int marked[(M >> 6) + 9];
vector<int> primes;
void sieve(int n) {
  memset(marked, 0, sizeof(marked));
  for (int i = 3; i * i <= n; i += 2)
    if (!(marked[i >> 6] & (1 << ((i >> 1) & 31))))
      for (int j = i * i; j <= n; j += (i + i))
        (marked[j >> 6] |= (1 << ((j >> 1) & 31)));
  primes.push_back(2);
  for (int i = 3; i <= n; i += 2)
    if (!(marked[i >> 6] & (1 << ((i >> 1) & 31)))) primes.push_back(i);
}
bool is_prime(int x) {
  if (x > 2 && x % 2 == 0) return false;
  if (x == 2 || !(marked[x >> 6] & (1 << ((x >> 1) & 31)))) return true;
  return false;
}
int n, one = 0, a[1001];
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  sieve(M);
  cin >> n;
  vector<int> ev, od;
  for (ll(i) = ll(0); (i) < (ll)(n); ++(i)) {
    cin >> a[i];
    if (a[i] == 1)
      one++;
    else if (a[i] & 1)
      od.push_back(a[i]);
    else
      ev.push_back(a[i]);
  }
  if (one > 1) {
    int ans = -1, xkxkx = 0;
    for (int i = 0; i < ev.size(); i++) {
      if (is_prime(1 + ev[i])) {
        ans = ev[i];
        xkxkx = 1;
        break;
      }
    }
    cout << one + xkxkx << '\n';
    for (ll(i) = ll(0); (i) < (ll)(one); ++(i)) cout << 1 << " ";
    if (ans > -1) cout << ans << '\n';
  } else {
    if (one == 1) od.push_back(1);
    int x = -1, y = -1, xkxkx = 0;
    for (int j = 0; j < od.size(); j++) {
      for (int i = 0; i < ev.size(); i++) {
        if (is_prime(od[j] + ev[i])) {
          x = ev[i];
          y = od[j];
          xkxkx = 2;
          break;
        }
      }
      if (x > -1 && y > -1) break;
    }
    if (xkxkx == 0) {
      cout << 1 << '\n' << a[0] << '\n';
    } else {
      cout << 2 << '\n' << x << " " << y << '\n';
    }
  }
}

```