AC:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < b; i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define index(a) (a - 'A')
#define transUpp(a) (a - 32)
#define transLow(a) (a + 32)
#define ll long long
#define PB push_back
int gcd(int a, int b){return b == 0 ? a : gcd(a%b, a);}
const int N = 20011;
int prime[N];
int main(int n, char**args)
{
cin >> n;
for (int i = 0; i < n; i++)
prime[i] = 1;
for (int i = 2; i <= n/2; i++)
if (prime[i])
for (int j = i*i; j < n; j += i)
prime[j] = 0;
for (int i = 2; i <= n/2; i++)
for (int j = i; j <= n/2; j++)
for (int k = n - 1; k > j; k--)
if (prime[i] && prime[j] && prime[k] && i + j + k == n)
{
cout << i << ' ' << j << ' ' << k << endl; return 0;
}
return 0;
}