#include <bits/stdc++.h>
using namespace std;
static struct IO {
  char tmp[1 << 10];
  char cur;
  inline char nextChar() { return cur = getc(stdin); }
  inline char peekChar() { return cur; }
  inline operator bool() { return peekChar(); }
  inline static bool isBlank(char c) { return (c < '-' && c); }
  inline bool skipBlanks() {
    while (isBlank(nextChar()))
      ;
    return peekChar() != 0;
  }
  inline IO& operator>>(char& c) {
    c = nextChar();
    return *this;
  }
  inline IO& operator>>(char* buf) {
    if (skipBlanks()) {
      if (peekChar()) {
        *(buf++) = peekChar();
        while (!isBlank(nextChar())) *(buf++) = peekChar();
      }
      *(buf++) = 0;
    }
    return *this;
  }
  inline IO& operator>>(string& s) {
    if (skipBlanks()) {
      s.clear();
      s += peekChar();
      while (!isBlank(nextChar())) s += peekChar();
    }
    return *this;
  }
  inline IO& operator>>(double& d) {
    if ((*this) >> tmp) sscanf(tmp, "%lf", &d);
    return *this;
  }
  inline IO& operator>>(int& n) {
    if (skipBlanks()) {
      int sign = +1;
      if (peekChar() == '-') {
        sign = -1;
        n = nextChar() - '0';
      } else
        n = peekChar() - '0';
      while (!isBlank(nextChar())) {
        n += n + (n << 3) + peekChar() - 48;
      }
      n *= sign;
    }
    return *this;
  }
  inline IO& operator>>(unsigned int& n) {
    if (skipBlanks()) {
      int sign = +1;
      if (peekChar() == '-') {
        sign = -1;
        n = nextChar() - '0';
      } else
        n = peekChar() - '0';
      while (!isBlank(nextChar())) {
        n += n + (n << 3) + peekChar() - 48;
      }
      n *= sign;
    }
    return *this;
  }
  inline IO& operator>>(long long& n) {
    if (skipBlanks()) {
      int sign = +1;
      if (peekChar() == '-') {
        sign = -1;
        n = nextChar() - '0';
      } else
        n = peekChar() - '0';
      while (!isBlank(nextChar())) {
        n += n + (n << 3) + peekChar() - 48;
      }
      n *= sign;
    }
    return *this;
  }
  inline void putChar(char c) { putc(c, stdout); }
  inline IO& operator<<(char c) {
    putChar(c);
    return *this;
  }
  inline IO& operator<<(const char* s) {
    while (*s) putChar(*s++);
    return *this;
  }
  inline IO& operator<<(const string& s) {
    for (int i = 0; i < (int)s.size(); ++i) putChar(s[i]);
    return *this;
  }
  char* toString(double d) {
    sprintf(tmp, "%lf%c", d, '\0');
    return tmp;
  }
  inline IO& operator<<(double d) { return (*this) << toString(d); }
  inline char* toString(int n) {
    char* p = (tmp + 30);
    if (n) {
      bool isNeg = 0;
      if (n < 0) isNeg = 1, n = -n;
      while (n) *--p = (n % 10) + '0', n /= 10;
      if (isNeg) *--p = '-';
    } else
      *--p = '0';
    return p;
  }
  inline IO& operator<<(int n) { return (*this) << toString(n); }
  inline char* toString(long long n) {
    char* p = (tmp + 30);
    if (n) {
      bool isNeg = 0;
      if (n < 0) isNeg = 1, n = -n;
      while (n) *--p = (n % 10) + '0', n /= 10;
      if (isNeg) *--p = '-';
    } else
      *--p = '0';
    return p;
  }
  inline IO& operator<<(long long n) { return (*this) << toString(n); }
} __io__;
int n, Max, c1;
int res1 = -1, res1_1 = -1;
pair<int, int> res2 = {-1, -1};
pair<int, int> res2_1 = {-1, -1};
int t[1007];
bitset<2000007> sieve;
int main() {
  __io__ >> n;
  for (int i = 1; i <= n; ++i) {
    __io__ >> t[i];
    if (t[i] == 1) c1++;
    Max = max(Max, t[i]);
  }
  sieve[1] = 1;
  for (int i = 2; i * i <= 2 * Max; ++i) {
    if (!sieve[i]) {
      for (int j = i * i; j <= 2 * Max; j += i) {
        sieve[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!sieve[t[i]]) {
      res1 = t[i];
      break;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!sieve[t[i] + 1] && c1 && t[i] != 1) {
      res1_1 = t[i];
      break;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (!sieve[t[i] + t[j]]) {
        res2 = {t[i], t[j]};
      }
      if (!sieve[t[i] + t[j]] && !sieve[t[i] + 1] && !sieve[t[j] + 1] && c1 &&
          t[i] != 1 && t[j] != 1) {
        res2_1 = {t[i], t[j]};
      }
    }
  }
  if (res2_1 != make_pair(-1, -1)) {
    __io__ << 2 + c1 << ('\n') << res2_1.first << " " << res2_1.second << " ";
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (res1_1 != -1 && c1 > 1) {
    __io__ << 1 + c1 << ('\n') << res1_1 << " ";
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (c1 > 2) {
    __io__ << c1 << ('\n');
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (res2 != make_pair(-1, -1)) {
    __io__ << 2 << ('\n') << res2.first << " " << res2.second;
    return 0;
  }
  if (res1_1 != -1) {
    __io__ << 1 + c1 << ('\n') << res1_1 << " ";
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (res1 != -1) {
    __io__ << 1 << ('\n') << res1;
    return 0;
  }
  __io__ << 1 << ('\n') << t[1];
}

### 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;
static struct IO {
  char tmp[1 << 10];
  char cur;
  inline char nextChar() { return cur = getc(stdin); }
  inline char peekChar() { return cur; }
  inline operator bool() { return peekChar(); }
  inline static bool isBlank(char c) { return (c < '-' && c); }
  inline bool skipBlanks() {
    while (isBlank(nextChar()))
      ;
    return peekChar() != 0;
  }
  inline IO& operator>>(char& c) {
    c = nextChar();
    return *this;
  }
  inline IO& operator>>(char* buf) {
    if (skipBlanks()) {
      if (peekChar()) {
        *(buf++) = peekChar();
        while (!isBlank(nextChar())) *(buf++) = peekChar();
      }
      *(buf++) = 0;
    }
    return *this;
  }
  inline IO& operator>>(string& s) {
    if (skipBlanks()) {
      s.clear();
      s += peekChar();
      while (!isBlank(nextChar())) s += peekChar();
    }
    return *this;
  }
  inline IO& operator>>(double& d) {
    if ((*this) >> tmp) sscanf(tmp, "%lf", &d);
    return *this;
  }
  inline IO& operator>>(int& n) {
    if (skipBlanks()) {
      int sign = +1;
      if (peekChar() == '-') {
        sign = -1;
        n = nextChar() - '0';
      } else
        n = peekChar() - '0';
      while (!isBlank(nextChar())) {
        n += n + (n << 3) + peekChar() - 48;
      }
      n *= sign;
    }
    return *this;
  }
  inline IO& operator>>(unsigned int& n) {
    if (skipBlanks()) {
      int sign = +1;
      if (peekChar() == '-') {
        sign = -1;
        n = nextChar() - '0';
      } else
        n = peekChar() - '0';
      while (!isBlank(nextChar())) {
        n += n + (n << 3) + peekChar() - 48;
      }
      n *= sign;
    }
    return *this;
  }
  inline IO& operator>>(long long& n) {
    if (skipBlanks()) {
      int sign = +1;
      if (peekChar() == '-') {
        sign = -1;
        n = nextChar() - '0';
      } else
        n = peekChar() - '0';
      while (!isBlank(nextChar())) {
        n += n + (n << 3) + peekChar() - 48;
      }
      n *= sign;
    }
    return *this;
  }
  inline void putChar(char c) { putc(c, stdout); }
  inline IO& operator<<(char c) {
    putChar(c);
    return *this;
  }
  inline IO& operator<<(const char* s) {
    while (*s) putChar(*s++);
    return *this;
  }
  inline IO& operator<<(const string& s) {
    for (int i = 0; i < (int)s.size(); ++i) putChar(s[i]);
    return *this;
  }
  char* toString(double d) {
    sprintf(tmp, "%lf%c", d, '\0');
    return tmp;
  }
  inline IO& operator<<(double d) { return (*this) << toString(d); }
  inline char* toString(int n) {
    char* p = (tmp + 30);
    if (n) {
      bool isNeg = 0;
      if (n < 0) isNeg = 1, n = -n;
      while (n) *--p = (n % 10) + '0', n /= 10;
      if (isNeg) *--p = '-';
    } else
      *--p = '0';
    return p;
  }
  inline IO& operator<<(int n) { return (*this) << toString(n); }
  inline char* toString(long long n) {
    char* p = (tmp + 30);
    if (n) {
      bool isNeg = 0;
      if (n < 0) isNeg = 1, n = -n;
      while (n) *--p = (n % 10) + '0', n /= 10;
      if (isNeg) *--p = '-';
    } else
      *--p = '0';
    return p;
  }
  inline IO& operator<<(long long n) { return (*this) << toString(n); }
} __io__;
int n, Max, c1;
int res1 = -1, res1_1 = -1;
pair<int, int> res2 = {-1, -1};
pair<int, int> res2_1 = {-1, -1};
int t[1007];
bitset<2000007> sieve;
int main() {
  __io__ >> n;
  for (int i = 1; i <= n; ++i) {
    __io__ >> t[i];
    if (t[i] == 1) c1++;
    Max = max(Max, t[i]);
  }
  sieve[1] = 1;
  for (int i = 2; i * i <= 2 * Max; ++i) {
    if (!sieve[i]) {
      for (int j = i * i; j <= 2 * Max; j += i) {
        sieve[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!sieve[t[i]]) {
      res1 = t[i];
      break;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (!sieve[t[i] + 1] && c1 && t[i] != 1) {
      res1_1 = t[i];
      break;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (!sieve[t[i] + t[j]]) {
        res2 = {t[i], t[j]};
      }
      if (!sieve[t[i] + t[j]] && !sieve[t[i] + 1] && !sieve[t[j] + 1] && c1 &&
          t[i] != 1 && t[j] != 1) {
        res2_1 = {t[i], t[j]};
      }
    }
  }
  if (res2_1 != make_pair(-1, -1)) {
    __io__ << 2 + c1 << ('\n') << res2_1.first << " " << res2_1.second << " ";
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (res1_1 != -1 && c1 > 1) {
    __io__ << 1 + c1 << ('\n') << res1_1 << " ";
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (c1 > 2) {
    __io__ << c1 << ('\n');
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (res2 != make_pair(-1, -1)) {
    __io__ << 2 << ('\n') << res2.first << " " << res2.second;
    return 0;
  }
  if (res1_1 != -1) {
    __io__ << 1 + c1 << ('\n') << res1_1 << " ";
    for (int i = 1; i <= c1; ++i) {
      __io__ << 1 << " ";
    }
    return 0;
  }
  if (res1 != -1) {
    __io__ << 1 << ('\n') << res1;
    return 0;
  }
  __io__ << 1 << ('\n') << t[1];
}

```