#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 != vec.size()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_multiset<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    os << "(" << itr->first << ", " << itr->second << ")";
    auto titr = itr;
    if (++titr != mp.end()) os << " ";
  }
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const unordered_map<T1, T2> &mp) {
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    os << "(" << itr->first << ", " << itr->second << ")";
    auto titr = itr;
    if (++titr != mp.end()) os << " ";
  }
  return os;
}
using ll = long long int;
using P = pair<int, int>;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1000000007;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
struct fast_io {
  fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(20);
  }
} fast_io_;
template <typename T>
T power(T a, T n, T mod) {
  T res = 1;
  T tmp = n;
  T curr = a;
  while (tmp) {
    if (tmp % 2 == 1) {
      res = (T)(res * curr % mod);
    }
    curr = (T)(curr * curr % mod);
    tmp >>= 1;
  }
  return res;
}
template <typename T>
bool suspect(T a, int s, T d, T n) {
  T x = power<T>(a, d, n);
  if (x == 1) return true;
  for (int r = 0; r < s; r++) {
    if (x == n - 1) return true;
    x = x * x % n;
  }
  return false;
}
template <typename T>
bool millar_rabin(T n) {
  if (n <= 1 || (n > 2 && n % 2 == 0)) return false;
  vector<ll> test = {2, 3, 5, 7, 11, 13, 17, 19, 23};
  T d = n - 1;
  int s = 0;
  while (d % 2 == 0) s++, d /= 2;
  for (int i = 0; i < test.size() && test[i] < n; i++) {
    if (!suspect<T>(test[i], s, d, n)) return false;
  }
  return true;
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  vector<ll> a(n);
  cin >> a;
  int cnt = 0;
  for (int i = (0); i < (n); ++i)
    if (a[i] == 1) cnt++;
  if (cnt >= 2) {
    for (int i = (0); i < (n); ++i) {
      if (a[i] == 1) continue;
      for (int j = (i + 1); j < (n); ++j) {
        if (a[j] == 1) continue;
        if (millar_rabin<ll>(a[i] + 1) && millar_rabin<ll>(a[j] + 1) &&
            millar_rabin<ll>(a[i] + a[j])) {
          cout << 2 + cnt << endl;
          for (int k = (0); k < (cnt); ++k) cout << "1 ";
          cout << a[i] << " " << a[j] << endl;
          return 0;
        }
      }
    }
    for (int i = (0); i < (n); ++i) {
      if (a[i] == 1) continue;
      if (millar_rabin<ll>(a[i] + 1)) {
        cout << 1 + cnt << endl;
        for (int k = (0); k < (cnt); ++k) cout << "1 ";
        cout << a[i] << endl;
        return 0;
      }
    }
  }
  if (cnt >= 2) {
    cout << cnt << endl;
    vector<int> ans(cnt, 1);
    cout << ans << endl;
    return 0;
  }
  for (int i = (0); i < (n); ++i) {
    for (int j = (i + 1); j < (n); ++j) {
      if (millar_rabin<ll>(a[i] + a[j])) {
        cout << 2 << endl;
        cout << a[i] << " " << a[j] << endl;
        return 0;
      }
    }
  }
  cout << 1 << endl;
  cout << a[0] << endl;
  return 0;
}

### 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;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 != vec.size()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_multiset<T> &st) {
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    os << *itr;
    auto titr = itr;
    if (++titr != st.end()) os << " ";
  }
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    os << "(" << itr->first << ", " << itr->second << ")";
    auto titr = itr;
    if (++titr != mp.end()) os << " ";
  }
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const unordered_map<T1, T2> &mp) {
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    os << "(" << itr->first << ", " << itr->second << ")";
    auto titr = itr;
    if (++titr != mp.end()) os << " ";
  }
  return os;
}
using ll = long long int;
using P = pair<int, int>;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1000000007;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
struct fast_io {
  fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(20);
  }
} fast_io_;
template <typename T>
T power(T a, T n, T mod) {
  T res = 1;
  T tmp = n;
  T curr = a;
  while (tmp) {
    if (tmp % 2 == 1) {
      res = (T)(res * curr % mod);
    }
    curr = (T)(curr * curr % mod);
    tmp >>= 1;
  }
  return res;
}
template <typename T>
bool suspect(T a, int s, T d, T n) {
  T x = power<T>(a, d, n);
  if (x == 1) return true;
  for (int r = 0; r < s; r++) {
    if (x == n - 1) return true;
    x = x * x % n;
  }
  return false;
}
template <typename T>
bool millar_rabin(T n) {
  if (n <= 1 || (n > 2 && n % 2 == 0)) return false;
  vector<ll> test = {2, 3, 5, 7, 11, 13, 17, 19, 23};
  T d = n - 1;
  int s = 0;
  while (d % 2 == 0) s++, d /= 2;
  for (int i = 0; i < test.size() && test[i] < n; i++) {
    if (!suspect<T>(test[i], s, d, n)) return false;
  }
  return true;
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  vector<ll> a(n);
  cin >> a;
  int cnt = 0;
  for (int i = (0); i < (n); ++i)
    if (a[i] == 1) cnt++;
  if (cnt >= 2) {
    for (int i = (0); i < (n); ++i) {
      if (a[i] == 1) continue;
      for (int j = (i + 1); j < (n); ++j) {
        if (a[j] == 1) continue;
        if (millar_rabin<ll>(a[i] + 1) && millar_rabin<ll>(a[j] + 1) &&
            millar_rabin<ll>(a[i] + a[j])) {
          cout << 2 + cnt << endl;
          for (int k = (0); k < (cnt); ++k) cout << "1 ";
          cout << a[i] << " " << a[j] << endl;
          return 0;
        }
      }
    }
    for (int i = (0); i < (n); ++i) {
      if (a[i] == 1) continue;
      if (millar_rabin<ll>(a[i] + 1)) {
        cout << 1 + cnt << endl;
        for (int k = (0); k < (cnt); ++k) cout << "1 ";
        cout << a[i] << endl;
        return 0;
      }
    }
  }
  if (cnt >= 2) {
    cout << cnt << endl;
    vector<int> ans(cnt, 1);
    cout << ans << endl;
    return 0;
  }
  for (int i = (0); i < (n); ++i) {
    for (int j = (i + 1); j < (n); ++j) {
      if (millar_rabin<ll>(a[i] + a[j])) {
        cout << 2 << endl;
        cout << a[i] << " " << a[j] << endl;
        return 0;
      }
    }
  }
  cout << 1 << endl;
  cout << a[0] << endl;
  return 0;
}

```