#include <bits/stdc++.h>
using namespace std;
template <class T>
T max3(T a, T b, T c) {
  return max2(max2(a, b), c);
}
template <class T>
T min3(T a, T b, T c) {
  return min2(min2(a, b), c);
}
template <class T>
T max4(T a, T b, T c, T d) {
  return max2(max2(a, b), max2(c, d));
}
template <class T>
T min4(T a, T b, T c, T d) {
  return min2(min2(a, b), max2(c, d));
}
const long long int mod = 1000000007ll;
const long long int MOD = 1000000009ll;
const long long int INF = LLONG_MAX / 10;
const int inf = INT_MAX / 2;
long long int count_bit(long long int _x) {
  long long int _ret = 0;
  while (_x) {
    if (_x % 2 == 1) _ret++;
    _x /= 2;
  }
  return _ret;
}
long long int check_bit(long long int _mask, long long int _i) {
  long long int x = 1;
  return (_mask & (x << _i)) == 0 ? 0 : 1;
}
long long int set_bit(long long int _mask, long long int _i) {
  long long int x = 1;
  _mask = _mask | (x << _i);
  return _mask;
}
long long int powermod(long long int _a, long long int _b,
                       long long int _m = mod) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long long int power(long long int _a, long long int _b) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a);
    _b /= 2;
    _a = (_a * _a);
  }
  return _r;
}
long long int add(long long int a, long long int b, long long int m = mod) {
  long long int x = a + b;
  while (x >= m) x -= m;
  return x;
}
long long int sub(long long int a, long long int b, long long int m = mod) {
  long long int x = a - b;
  while (x < 0) x += m;
  return x;
}
long long int mul(long long int a, long long int b, long long int m = mod) {
  long long int x = a * b;
  x %= m;
  return x;
}
long long int gcd(long long int a, long long int b) {
  if (a < b) {
    a = a ^ b;
    b = a ^ b;
    a = a ^ b;
  }
  if (b == 0) return a;
  long long int t;
  while (b) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
vector<string> _split(const string& second, char c) {
  vector<string> v;
  stringstream ss(second);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return v;
}
bool prime[2000010];
long long int pf[2000010];
void sieve() {
  fill(prime, prime + 2000010, true);
  prime[0] = prime[1] = false;
  for (long long int i = 2; i < 2000010; i++) {
    if (prime[i]) {
      pf[i] = i;
      for (long long int j = i * i; j < 2000010; j += i) {
        prime[j] = false;
        if (pf[j] == -1) pf[j] = i;
      }
    }
  }
}
pair<int, int> operator+(const pair<int, int>& l, const pair<int, int>& r) {
  pair<int, int> ret;
  ret.first = l.first + r.first;
  ret.second = l.second + r.second;
  return ret;
}
struct cmp {
  bool operator()(pair<pair<int, int>, int> const& l,
                  pair<pair<int, int>, int> const& r) {
    return l.first.second < r.first.second;
  }
} myobject;
int n, a[1010];
int main() {
  if (0) {
    freopen("C:\\Users\\Smit Patel\\Desktop\\my.txt", "r", stdin);
    freopen("C:\\Users\\Smit Patel\\Desktop\\out.txt", "w", stdout);
  }
  sieve();
  scanf("%d", &n);
  ;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  ;
  int cnt = 0;
  vector<pair<int, int> > v;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1) cnt++;
    for (int j = i + 1; j <= n; j++) {
      if (prime[a[i] + a[j]]) v.push_back(make_pair(a[i], a[j]));
    }
  }
  if (cnt == 0) {
    if (v.size() == 0)
      cout << "1\n" << a[1];
    else
      cout << "2\n" << v[0].first << " " << v[0].second;
  } else {
    if (v.size() == 0) {
      printf("%d", cnt);
      ;
      printf("\n");
      ;
      for (int i = 1; i <= cnt; i++) {
        printf("%d", 1);
        ;
        printf(" ");
        ;
      }
    } else {
      for (auto p : v) {
        if (prime[p.first + 1] && prime[p.second + 1] && p.first != 1 &&
            p.second != 1) {
          printf("%d", cnt + 2);
          ;
          printf("\n");
          ;
          for (int i = 1; i <= cnt; i++) {
            printf("%d", 1);
            ;
            printf(" ");
            ;
          }
          printf("%d %d", p.first, p.second);
          ;
          return 0;
        }
      }
      for (auto p : v) {
        if (prime[p.first + 1] && prime[p.second + 1] && p.first == 1 &&
            p.second != 1) {
          printf("%d", cnt + 1);
          ;
          printf("\n");
          ;
          for (int i = 1; i <= cnt; i++) {
            printf("%d", 1);
            ;
            printf(" ");
            ;
          }
          printf("%d", p.second);
          ;
          return 0;
        } else if (prime[p.first + 1] && prime[p.second + 1] && p.first != 1 &&
                   p.second == 1) {
          printf("%d", cnt + 1);
          ;
          printf("\n");
          ;
          for (int i = 1; i <= cnt; i++) {
            printf("%d", 1);
            ;
            printf(" ");
            ;
          }
          printf("%d", p.first);
          ;
          return 0;
        }
      }
      if (cnt == 1)
        cout << "2\n" << v[0].first << " " << v[0].second;
      else {
        printf("%d", cnt);
        ;
        printf("\n");
        ;
        for (int i = 1; i <= cnt; i++) {
          printf("%d", 1);
          ;
          printf(" ");
          ;
        }
      }
    }
  }
  return 0;
}

### Prompt

In Cpp, your task is to solve 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>
T max3(T a, T b, T c) {
  return max2(max2(a, b), c);
}
template <class T>
T min3(T a, T b, T c) {
  return min2(min2(a, b), c);
}
template <class T>
T max4(T a, T b, T c, T d) {
  return max2(max2(a, b), max2(c, d));
}
template <class T>
T min4(T a, T b, T c, T d) {
  return min2(min2(a, b), max2(c, d));
}
const long long int mod = 1000000007ll;
const long long int MOD = 1000000009ll;
const long long int INF = LLONG_MAX / 10;
const int inf = INT_MAX / 2;
long long int count_bit(long long int _x) {
  long long int _ret = 0;
  while (_x) {
    if (_x % 2 == 1) _ret++;
    _x /= 2;
  }
  return _ret;
}
long long int check_bit(long long int _mask, long long int _i) {
  long long int x = 1;
  return (_mask & (x << _i)) == 0 ? 0 : 1;
}
long long int set_bit(long long int _mask, long long int _i) {
  long long int x = 1;
  _mask = _mask | (x << _i);
  return _mask;
}
long long int powermod(long long int _a, long long int _b,
                       long long int _m = mod) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long long int power(long long int _a, long long int _b) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a);
    _b /= 2;
    _a = (_a * _a);
  }
  return _r;
}
long long int add(long long int a, long long int b, long long int m = mod) {
  long long int x = a + b;
  while (x >= m) x -= m;
  return x;
}
long long int sub(long long int a, long long int b, long long int m = mod) {
  long long int x = a - b;
  while (x < 0) x += m;
  return x;
}
long long int mul(long long int a, long long int b, long long int m = mod) {
  long long int x = a * b;
  x %= m;
  return x;
}
long long int gcd(long long int a, long long int b) {
  if (a < b) {
    a = a ^ b;
    b = a ^ b;
    a = a ^ b;
  }
  if (b == 0) return a;
  long long int t;
  while (b) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
vector<string> _split(const string& second, char c) {
  vector<string> v;
  stringstream ss(second);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return v;
}
bool prime[2000010];
long long int pf[2000010];
void sieve() {
  fill(prime, prime + 2000010, true);
  prime[0] = prime[1] = false;
  for (long long int i = 2; i < 2000010; i++) {
    if (prime[i]) {
      pf[i] = i;
      for (long long int j = i * i; j < 2000010; j += i) {
        prime[j] = false;
        if (pf[j] == -1) pf[j] = i;
      }
    }
  }
}
pair<int, int> operator+(const pair<int, int>& l, const pair<int, int>& r) {
  pair<int, int> ret;
  ret.first = l.first + r.first;
  ret.second = l.second + r.second;
  return ret;
}
struct cmp {
  bool operator()(pair<pair<int, int>, int> const& l,
                  pair<pair<int, int>, int> const& r) {
    return l.first.second < r.first.second;
  }
} myobject;
int n, a[1010];
int main() {
  if (0) {
    freopen("C:\\Users\\Smit Patel\\Desktop\\my.txt", "r", stdin);
    freopen("C:\\Users\\Smit Patel\\Desktop\\out.txt", "w", stdout);
  }
  sieve();
  scanf("%d", &n);
  ;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  ;
  int cnt = 0;
  vector<pair<int, int> > v;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1) cnt++;
    for (int j = i + 1; j <= n; j++) {
      if (prime[a[i] + a[j]]) v.push_back(make_pair(a[i], a[j]));
    }
  }
  if (cnt == 0) {
    if (v.size() == 0)
      cout << "1\n" << a[1];
    else
      cout << "2\n" << v[0].first << " " << v[0].second;
  } else {
    if (v.size() == 0) {
      printf("%d", cnt);
      ;
      printf("\n");
      ;
      for (int i = 1; i <= cnt; i++) {
        printf("%d", 1);
        ;
        printf(" ");
        ;
      }
    } else {
      for (auto p : v) {
        if (prime[p.first + 1] && prime[p.second + 1] && p.first != 1 &&
            p.second != 1) {
          printf("%d", cnt + 2);
          ;
          printf("\n");
          ;
          for (int i = 1; i <= cnt; i++) {
            printf("%d", 1);
            ;
            printf(" ");
            ;
          }
          printf("%d %d", p.first, p.second);
          ;
          return 0;
        }
      }
      for (auto p : v) {
        if (prime[p.first + 1] && prime[p.second + 1] && p.first == 1 &&
            p.second != 1) {
          printf("%d", cnt + 1);
          ;
          printf("\n");
          ;
          for (int i = 1; i <= cnt; i++) {
            printf("%d", 1);
            ;
            printf(" ");
            ;
          }
          printf("%d", p.second);
          ;
          return 0;
        } else if (prime[p.first + 1] && prime[p.second + 1] && p.first != 1 &&
                   p.second == 1) {
          printf("%d", cnt + 1);
          ;
          printf("\n");
          ;
          for (int i = 1; i <= cnt; i++) {
            printf("%d", 1);
            ;
            printf(" ");
            ;
          }
          printf("%d", p.first);
          ;
          return 0;
        }
      }
      if (cnt == 1)
        cout << "2\n" << v[0].first << " " << v[0].second;
      else {
        printf("%d", cnt);
        ;
        printf("\n");
        ;
        for (int i = 1; i <= cnt; i++) {
          printf("%d", 1);
          ;
          printf(" ");
          ;
        }
      }
    }
  }
  return 0;
}

```