#include <bits/stdc++.h>
using namespace std;
double tick() {
  static clock_t oldtick;
  clock_t newtick = clock();
  double diff = 1.0 * (newtick - oldtick) / CLOCKS_PER_SEC;
  oldtick = newtick;
  return diff;
}
long long gcd(long long a, long long b) {
  if ((a == 0) || (b == 0)) return a + b;
  return gcd(b, a % b);
}
long long pow_mod(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
bool isPrime(long long a) {
  for (int i = 3; (i * i) <= a; i += 2) {
    if ((a % i) == 0) return false;
  }
  if ((a != 2) && ((a % 2) == 0)) return false;
  return true;
}
string con_ll_to_str(long long a) {
  stringstream mystr;
  mystr << a;
  return mystr.str();
}
long long con_str_to_ll(string st) {
  long long numb = 0;
  int len = st.size(), i, j = 0;
  for (i = len - 1; i >= 0; i--) {
    numb += (pow_mod(10, j) * (st[i] - '0'));
    j++;
  }
  return numb;
}
long long arr[1100], no_of_one;
bool bo[4000100], ma[4000100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, N, ans = 0, kk, opop1, opop2;
  string st;
  cin >> N;
  for (i = 1; i <= N; i++) {
    cin >> arr[i];
    if (arr[i] == 1) {
      no_of_one++;
    }
  }
  for (i = 2; i <= 2000000; i++) {
    if (!bo[i]) {
      ma[i] = 1;
      for (j = 1; j <= 1000000; j++) {
        if ((j * i) > 2e6) break;
        bo[(j * i)] = 1;
      }
    }
  }
  if (N == 1) {
    cout << "1"
         << "\n";
    cout << arr[1];
    return 0;
  }
  if (no_of_one <= 1) {
    for (i = 1; i <= N; i++) {
      for (j = i + 1; j <= N; j++) {
        if (ma[arr[i] + arr[j]]) {
          cout << "2"
               << "\n";
          cout << arr[i] << " " << arr[j];
          return 0;
        }
      }
    }
    for (i = 1; i <= N; i++) {
      cout << "1"
           << "\n";
      cout << arr[i];
      return 0;
    }
  } else {
    for (i = 1; i <= N; i++) {
      if ((arr[i] != 1) && (ma[arr[i] + 1])) {
        cout << no_of_one + 1 << "\n";
        for (j = 1; j <= no_of_one; j++) cout << "1 ";
        cout << arr[i];
        return 0;
      }
    }
    cout << no_of_one << "\n";
    for (i = 1; i <= no_of_one; i++) {
      cout << "1 ";
    }
  }
  return 0;
}

### Prompt

Please create a solution in CPP 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;
double tick() {
  static clock_t oldtick;
  clock_t newtick = clock();
  double diff = 1.0 * (newtick - oldtick) / CLOCKS_PER_SEC;
  oldtick = newtick;
  return diff;
}
long long gcd(long long a, long long b) {
  if ((a == 0) || (b == 0)) return a + b;
  return gcd(b, a % b);
}
long long pow_mod(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
bool isPrime(long long a) {
  for (int i = 3; (i * i) <= a; i += 2) {
    if ((a % i) == 0) return false;
  }
  if ((a != 2) && ((a % 2) == 0)) return false;
  return true;
}
string con_ll_to_str(long long a) {
  stringstream mystr;
  mystr << a;
  return mystr.str();
}
long long con_str_to_ll(string st) {
  long long numb = 0;
  int len = st.size(), i, j = 0;
  for (i = len - 1; i >= 0; i--) {
    numb += (pow_mod(10, j) * (st[i] - '0'));
    j++;
  }
  return numb;
}
long long arr[1100], no_of_one;
bool bo[4000100], ma[4000100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, N, ans = 0, kk, opop1, opop2;
  string st;
  cin >> N;
  for (i = 1; i <= N; i++) {
    cin >> arr[i];
    if (arr[i] == 1) {
      no_of_one++;
    }
  }
  for (i = 2; i <= 2000000; i++) {
    if (!bo[i]) {
      ma[i] = 1;
      for (j = 1; j <= 1000000; j++) {
        if ((j * i) > 2e6) break;
        bo[(j * i)] = 1;
      }
    }
  }
  if (N == 1) {
    cout << "1"
         << "\n";
    cout << arr[1];
    return 0;
  }
  if (no_of_one <= 1) {
    for (i = 1; i <= N; i++) {
      for (j = i + 1; j <= N; j++) {
        if (ma[arr[i] + arr[j]]) {
          cout << "2"
               << "\n";
          cout << arr[i] << " " << arr[j];
          return 0;
        }
      }
    }
    for (i = 1; i <= N; i++) {
      cout << "1"
           << "\n";
      cout << arr[i];
      return 0;
    }
  } else {
    for (i = 1; i <= N; i++) {
      if ((arr[i] != 1) && (ma[arr[i] + 1])) {
        cout << no_of_one + 1 << "\n";
        for (j = 1; j <= no_of_one; j++) cout << "1 ";
        cout << arr[i];
        return 0;
      }
    }
    cout << no_of_one << "\n";
    for (i = 1; i <= no_of_one; i++) {
      cout << "1 ";
    }
  }
  return 0;
}

```