原题链接
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
const ll N = 1e6 + 9;
const ll mod = 1000000007;
ll pr[N];
bool vis[N];
int cnt;
void getpr() {
for (int i = 2; i < N; i ++) {
if (!vis[i] )pr[++cnt] = i;
for (int j = 1; j <=cnt &&pr[j] * i < N; j ++) {
vis[i * pr[j]] = 1;
if (i % pr[j] == 0)break;
}
}
}
bool ispr(ll n) {
for (ll i = 2; i * i <= n; i ++) {
if (n % i==0)return 0;
}return 1;
}
void solve() {
getpr();
ll n = 2;
cin >> n;
if (ispr(n)) {
cout << 1 << "
" << n << endl;return;
}
cout <<3 << endl;
ll m = 4;
for (;m <= 300; m ++) {
if (ispr(n-m)) {
cout << n-m << " ";break;
}
}
for (ll i = 1; pr[i] <= m; i ++) {
for (ll j = 1; pr[j] + pr[i] <= m; j ++) {
if (pr[i] + pr[j] == m) {
cout << pr[i] << " " << pr[j] << endl;
return;
}
}
}
return;
}
signed main() {
ios::sync_with_stdio(0);
ll t = 1;
while (t--) solve();
return 0;
}