#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char& ch) {
  string s = "";
  s += ch;
  return "'" + s + "', ";
}
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
const long long mod = (long long)1000000007;
const long long inf = (long long)2e18;
const long long maxn = 3e6;
long long spf[maxn + 1];
void precompute() {
  for (long long i = 2; i <= maxn; i++) {
    if (!spf[i]) {
      spf[i] = i;
      for (long long j = i + i; j <= maxn; j += i) {
        if (!spf[j]) spf[j] = i;
      }
    }
  }
}
bool isprime(long long n) { return spf[n] == n; }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(9);
  precompute();
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long& x : a) cin >> x;
  vector<long long> b;
  for (long long i = 0; i < n; ++i) {
    for (long long j = i + 1; j < n; ++j) {
      if (isprime(a[i] + a[j])) {
        b.push_back(a[i]);
        b.push_back(a[j]);
        goto label;
      }
    }
  }
label:;
  if (!((long long)(b).size())) {
    b.push_back(a[0]);
  }
  vector<long long> c;
  for (long long i = 0; i < n; ++i) {
    if (a[i] == 1) {
      c.push_back(a[i]);
    }
  }
  for (long long i = 0; i < n; ++i) {
    if (isprime(a[i] + 1) && a[i] != 1) {
      c.push_back(a[i]);
      break;
    }
  }
  42;
  42;
  if (((long long)(b).size()) < ((long long)(c).size())) swap(b, c);
  cout << ((long long)(b).size()) << '\n';
  for (long long& x : b) cout << x << " ";
  cout << '\n';
  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 <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char& ch) {
  string s = "";
  s += ch;
  return "'" + s + "', ";
}
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
const long long mod = (long long)1000000007;
const long long inf = (long long)2e18;
const long long maxn = 3e6;
long long spf[maxn + 1];
void precompute() {
  for (long long i = 2; i <= maxn; i++) {
    if (!spf[i]) {
      spf[i] = i;
      for (long long j = i + i; j <= maxn; j += i) {
        if (!spf[j]) spf[j] = i;
      }
    }
  }
}
bool isprime(long long n) { return spf[n] == n; }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(9);
  precompute();
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long& x : a) cin >> x;
  vector<long long> b;
  for (long long i = 0; i < n; ++i) {
    for (long long j = i + 1; j < n; ++j) {
      if (isprime(a[i] + a[j])) {
        b.push_back(a[i]);
        b.push_back(a[j]);
        goto label;
      }
    }
  }
label:;
  if (!((long long)(b).size())) {
    b.push_back(a[0]);
  }
  vector<long long> c;
  for (long long i = 0; i < n; ++i) {
    if (a[i] == 1) {
      c.push_back(a[i]);
    }
  }
  for (long long i = 0; i < n; ++i) {
    if (isprime(a[i] + 1) && a[i] != 1) {
      c.push_back(a[i]);
      break;
    }
  }
  42;
  42;
  if (((long long)(b).size()) < ((long long)(c).size())) swap(b, c);
  cout << ((long long)(b).size()) << '\n';
  for (long long& x : b) cout << x << " ";
  cout << '\n';
  return 0;
}

```