#include <bits/stdc++.h>
using namespace std;
int checkprime(int n) {
  int i, flag = 1;
  for (i = 2; i <= n / 2; ++i) {
    if (n % i == 0) {
      flag = 0;
      break;
    }
  }
  return flag;
}
map<long long int, long long int> mp;
set<long long int> evn;
set<long long int> odd;
int main() {
  long int i, j, n, f2 = 0, f = 0, temp = 0, count, tevn = 0, todd = 0;
  cin >> n;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ++mp[a[i]];
    if (a[i] == 2) f2 = 1;
    if (a[i] % 2 == 0)
      evn.insert(a[i]);
    else if (a[i] > 1)
      odd.insert(a[i]);
  }
  if (mp[1] >= 2) {
    set<long long int>::iterator itr = evn.begin();
    while (itr != evn.end()) {
      if (checkprime((*itr) + 1)) {
        temp = (*itr);
        break;
      }
      itr++;
    }
    count = mp[1];
    if (temp != 0)
      cout << count + 1 << endl;
    else
      cout << count << endl;
    for (i = 0; i < count; i++) {
      printf("1\n");
    }
    if (temp != 0) {
      cout << temp << endl;
    }
  } else if (mp[1] == 1) {
    if (f2 == 1) {
      cout << 2 << endl;
      cout << 1 << endl << 2 << endl;
      return 0;
    } else {
      set<long long int>::iterator itrevn = evn.begin();
      set<long long int>::iterator itrodd;
      while (itrevn != evn.end()) {
        itrodd = odd.begin();
        while (itrodd != odd.end()) {
          if (checkprime((*itrevn) + (*itrodd))) {
            f = 1;
            tevn = (*itrevn);
            todd = (*itrodd);
            break;
          }
          itrodd++;
        }
        if (f == 1) break;
        itrevn++;
      }
      if (tevn > 0 && todd > 0) {
        cout << 2 << endl << tevn << endl << todd << endl;
        return 0;
      }
      set<long long int>::iterator itr = evn.begin();
      while (itr != evn.end()) {
        if (checkprime((*itr) + 1)) {
          temp = (*itr);
          break;
        }
        itr++;
      }
      if (temp != 0) {
        cout << 2 << endl << 1 << endl << temp << endl;
        return 0;
      }
    }
    cout << 1 << endl << 1 << endl;
    return 0;
  } else {
    long int te = 0, to = 0;
    long int fe = 0, fo = 0;
    set<long long int>::iterator itrevn = evn.begin();
    set<long long int>::iterator itrodd;
    while (itrevn != evn.end()) {
      itrodd = odd.begin();
      while (itrodd != odd.end()) {
        if (checkprime((*itrevn) + (*itrodd))) {
          f = 1;
          tevn = (*itrevn);
          todd = (*itrodd);
          break;
        }
        itrodd++;
      }
      if (f == 1) break;
      itrevn++;
    }
    if (f == 1) {
      cout << 2 << endl << tevn << endl << todd << endl;
      return 0;
    }
    if (evn.size() > 0) {
      te = *(evn.begin());
      cout << 1 << endl << te << endl;
      return 0;
    }
    if (odd.size() > 0) {
      to = *(odd.begin());
      cout << 1 << endl << to << endl;
      return 0;
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
}

### Prompt

Construct a CPP code solution to the problem outlined:

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;
int checkprime(int n) {
  int i, flag = 1;
  for (i = 2; i <= n / 2; ++i) {
    if (n % i == 0) {
      flag = 0;
      break;
    }
  }
  return flag;
}
map<long long int, long long int> mp;
set<long long int> evn;
set<long long int> odd;
int main() {
  long int i, j, n, f2 = 0, f = 0, temp = 0, count, tevn = 0, todd = 0;
  cin >> n;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ++mp[a[i]];
    if (a[i] == 2) f2 = 1;
    if (a[i] % 2 == 0)
      evn.insert(a[i]);
    else if (a[i] > 1)
      odd.insert(a[i]);
  }
  if (mp[1] >= 2) {
    set<long long int>::iterator itr = evn.begin();
    while (itr != evn.end()) {
      if (checkprime((*itr) + 1)) {
        temp = (*itr);
        break;
      }
      itr++;
    }
    count = mp[1];
    if (temp != 0)
      cout << count + 1 << endl;
    else
      cout << count << endl;
    for (i = 0; i < count; i++) {
      printf("1\n");
    }
    if (temp != 0) {
      cout << temp << endl;
    }
  } else if (mp[1] == 1) {
    if (f2 == 1) {
      cout << 2 << endl;
      cout << 1 << endl << 2 << endl;
      return 0;
    } else {
      set<long long int>::iterator itrevn = evn.begin();
      set<long long int>::iterator itrodd;
      while (itrevn != evn.end()) {
        itrodd = odd.begin();
        while (itrodd != odd.end()) {
          if (checkprime((*itrevn) + (*itrodd))) {
            f = 1;
            tevn = (*itrevn);
            todd = (*itrodd);
            break;
          }
          itrodd++;
        }
        if (f == 1) break;
        itrevn++;
      }
      if (tevn > 0 && todd > 0) {
        cout << 2 << endl << tevn << endl << todd << endl;
        return 0;
      }
      set<long long int>::iterator itr = evn.begin();
      while (itr != evn.end()) {
        if (checkprime((*itr) + 1)) {
          temp = (*itr);
          break;
        }
        itr++;
      }
      if (temp != 0) {
        cout << 2 << endl << 1 << endl << temp << endl;
        return 0;
      }
    }
    cout << 1 << endl << 1 << endl;
    return 0;
  } else {
    long int te = 0, to = 0;
    long int fe = 0, fo = 0;
    set<long long int>::iterator itrevn = evn.begin();
    set<long long int>::iterator itrodd;
    while (itrevn != evn.end()) {
      itrodd = odd.begin();
      while (itrodd != odd.end()) {
        if (checkprime((*itrevn) + (*itrodd))) {
          f = 1;
          tevn = (*itrevn);
          todd = (*itrodd);
          break;
        }
        itrodd++;
      }
      if (f == 1) break;
      itrevn++;
    }
    if (f == 1) {
      cout << 2 << endl << tevn << endl << todd << endl;
      return 0;
    }
    if (evn.size() > 0) {
      te = *(evn.begin());
      cout << 1 << endl << te << endl;
      return 0;
    }
    if (odd.size() > 0) {
      to = *(odd.begin());
      cout << 1 << endl << to << endl;
      return 0;
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
}

```