// In the name of God
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <assert.h>
#include <bitset>
#include <unordered_set>
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
using namespace std;
template <typename T>
T next_int() {
T x = 0, p = 1;
char ch;
do { ch = getchar(); } while(ch <= ' ');
if(ch == '-') {
p = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9') {
x = x * 10 + (ch - '0');
ch = getchar();
}
return p * x;
}
string next_token() {
char ch;
string ans = "";
do { ch = getchar(); } while(ch <= ' ');
while(ch > ' ') {
ans += ch;
ch = getchar();
}
return ans;
}
const long long INF = (long long)1e18 + 227 + 1;
const int INFINT = 1e9 + 227 + 1;
const int MAXN = (int)1e6 + 227 + 1;
const int MOD = (int)1e9 + 7;
const long double EPS = 1e-9;
long long bin_pow(long long a, long long b) {
if(!b) return 1;
long long ans = bin_pow(a, b / 2);
ans = ans * ans % MOD;
if(b % 2) ans = ans * a % MOD;
return ans;
}
vector<long long> prime;
bool used[MAXN];
void build_prime() {
for(int i = 2; i < MAXN; i++) {
if(used[i]) continue;
prime.push_back(i);
for(int j = i; j < MAXN; j += i)
used[j] = 1;
}
}
int main() {
freopen(".in", "w", stdout);
build_prime();
int mx = -INFINT, p = -1;
for(int l = 0; l + 1 < 1000; l++) {
int k = 0;
for(int r = l; r < prime.size(); r++) {
if(prime[r] >= min((long long)1e6, prime[l] * prime[l + 1] - 1))
break;
k++;
}
if(k > mx) {
mx = k;
p = l;
}
}
vector<int> ans;
int l = p;
for(int r = l; r < prime.size(); r++) {
if(prime[r] >= min((long long)1e6, prime[l] * prime[l + 1] - 1))
break;
ans.push_back(prime[r]);
}
ans.push_back(min((long long)1e6, prime[l] * prime[l + 1] - 1));
ans.push_back(min((long long)1e6, prime[l] * prime[l + 1] - 1));
cout << ans.size() << "\n";
for(int i = 0; i < ans.size(); i++)
cout <<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gICAgICBmb3IoaW50IHIgPSBsOyByIDwgcHJpbWUuc2l6ZSgpOyByKyspIHsKICAgICAgICAgICAgaWYocHJpbWVbcl0gPj0gbWluKChsb25nIGxvbmcpMWU2LCBwcmltZVtsXSAqIHByaW1lW2wgKyAxXSAtIDEpKQogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGsrKzsKICAgICAgICB9CgogICAgICAgIGlmKGsgPiBteCkgewogICAgICAgICAgICBteCA9IGs7CiAgICAgICAgICAgIHAgPSBsOwogICAgICAgIH0KICAgIH0KCiAgICB2ZWN0b3I8aW50PiBhbnM7CgogICAgaW50IGwgPSBwOwogICAgZm9yKGludCByID0gbDsgciA8IHByaW1lLnNpemUoKTsgcisrKSB7CiAgICAgICAgaWYocHJpbWVbcl0gPj0gbWluKChsb25nIGxvbmcpMWU2LCBwcmltZVtsXSAqIHByaW1lW2wgKyAxXSAtIDEpKQogICAgICAgICAgICBicmVhazsKICAgICAgICBhbnMucHVzaF9iYWNrKHByaW1lW3JdKTsKICAgIH0KCiAgICBhbnMucHVzaF9iYWNrKG1pbigobG9uZyBsb25nKTFlNiwgcHJpbWVbbF0gKiBwcmltZVtsICsgMV0gLSAxKSk7CiAgICBhbnMucHVzaF9iYWNrKG1pbigobG9uZyBsb25nKTFlNiwgcHJpbWVbbF0gKiBwcmltZVtsICsgMV0gLSAxKSk7CgogICAgY291dCA8PCBhbnMuc2l6ZSgpIDw8ICJcbiI7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgYW5zLnNpemUoKTsgaSsrKQogICAgICAgIGNvdXQgPDwgYW5zW2ldIDw8ICIgIjsKICAgIHB1dHMoIiIpOwp9Cg==