#include <bits/stdc++.h>
using namespace std;
bool less_vectors(const vector<int>& a, const vector<int>& b) {
  return a.size() > b.size();
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
class compr {
 public:
  bool operator()(pair<pair<int, long long>, int> p1,
                  pair<pair<int, long long>, int> p2) {
    if (p1.first.second != p2.first.second)
      return p1.first.second > p2.first.second;
    else if (p1.second != p2.second)
      return p1.second > p2.second;
    else
      return p1.first < p2.first;
  }
};
long long fastexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1)
      res = (((res) % 1000000007) * ((a) % 1000000007)) % 1000000007;
    a = (((a) % 1000000007) * ((a) % 1000000007)) % 1000000007;
    b /= 2;
  }
  return res;
}
long long fastexpom(long long a, long long b, long long m) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = (((res) % m) * ((a) % m)) % m;
    a = (((a) % m) * ((a) % m)) % m;
    b /= 2;
  }
  return res;
}
long long modinv(long long a, long long m = 1000000007) {
  return fastexpom(a, m - 2, m);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  std::vector<int> isPrime(2000001, 1);
  for (int i = 2; i <= 2000000; i++) {
    if (isPrime[i]) {
      for (int j = 2; i * j <= 2000000; j++) isPrime[i * j] = 0;
    }
  }
  vector<int> v(n);
  int f1 = 0;
  int kk = 0;
  int ind1, ind2;
  ind1 = -1;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (isPrime[1 + v[i]] && 1 + v[i] != 2) {
      kk = 1;
      ind1 = i;
    }
    if (v[i] == 1) {
      f1++;
    }
  }
  int ans = f1 ? f1 + kk : 0;
  if (ans <= 2) {
    int ind3 = -1;
    for (int i = 0; i < n; i++) {
      if (isPrime[v[i]]) ind3 = i;
      for (int j = i + 1; j < n; j++)
        if (isPrime[v[i] + v[j]]) {
          ans = 2;
          ind1 = i;
          ind2 = j;
        }
    }
    if (ans == 2) {
      cout << 2 << "\n" << v[ind1] << " " << v[ind2];
    } else if (ind3 != -1)
      cout << 1 << "\n" << v[ind3];
    else
      cout << 1 << "\n" << v[0];
  } else {
    cout << ans << "\n";
    for (int i = 0; i < f1; i++) cout << 1 << " ";
    if (ind1 != -1) cout << v[ind1];
  }
  return 0;
}

### Prompt

Your challenge is to write 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;
bool less_vectors(const vector<int>& a, const vector<int>& b) {
  return a.size() > b.size();
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
class compr {
 public:
  bool operator()(pair<pair<int, long long>, int> p1,
                  pair<pair<int, long long>, int> p2) {
    if (p1.first.second != p2.first.second)
      return p1.first.second > p2.first.second;
    else if (p1.second != p2.second)
      return p1.second > p2.second;
    else
      return p1.first < p2.first;
  }
};
long long fastexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1)
      res = (((res) % 1000000007) * ((a) % 1000000007)) % 1000000007;
    a = (((a) % 1000000007) * ((a) % 1000000007)) % 1000000007;
    b /= 2;
  }
  return res;
}
long long fastexpom(long long a, long long b, long long m) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = (((res) % m) * ((a) % m)) % m;
    a = (((a) % m) * ((a) % m)) % m;
    b /= 2;
  }
  return res;
}
long long modinv(long long a, long long m = 1000000007) {
  return fastexpom(a, m - 2, m);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  std::vector<int> isPrime(2000001, 1);
  for (int i = 2; i <= 2000000; i++) {
    if (isPrime[i]) {
      for (int j = 2; i * j <= 2000000; j++) isPrime[i * j] = 0;
    }
  }
  vector<int> v(n);
  int f1 = 0;
  int kk = 0;
  int ind1, ind2;
  ind1 = -1;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (isPrime[1 + v[i]] && 1 + v[i] != 2) {
      kk = 1;
      ind1 = i;
    }
    if (v[i] == 1) {
      f1++;
    }
  }
  int ans = f1 ? f1 + kk : 0;
  if (ans <= 2) {
    int ind3 = -1;
    for (int i = 0; i < n; i++) {
      if (isPrime[v[i]]) ind3 = i;
      for (int j = i + 1; j < n; j++)
        if (isPrime[v[i] + v[j]]) {
          ans = 2;
          ind1 = i;
          ind2 = j;
        }
    }
    if (ans == 2) {
      cout << 2 << "\n" << v[ind1] << " " << v[ind2];
    } else if (ind3 != -1)
      cout << 1 << "\n" << v[ind3];
    else
      cout << 1 << "\n" << v[0];
  } else {
    cout << ans << "\n";
    for (int i = 0; i < f1; i++) cout << 1 << " ";
    if (ind1 != -1) cout << v[ind1];
  }
  return 0;
}

```