#include <bits/stdc++.h>
using namespace std;
#define task "DPRIME3"
#define ll long long int
#define pb push_back
#define el "\n"
#define vpll vector<pair<ll, ll>> 
#define vll vector<long long>
#define pii pair<int, int>
#define pqll priority_queue
const ll N = 1e6 + 2;
const ll MOD = 1e9 + 7;
const ll INF = 1e5;
ll n, x, y, z;
vector<bool> f(MOD, 1);
void tassk(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    if (fopen(task".inp","r"))
    {
        freopen(task".inp","r",stdin);
        freopen(task".out","w",stdout);
    }
}
void solve() {
    f[0] = f[1] = 0;
    cin >> n;
    for (int i = 2; i <= sqrt(n); i++){
        if (f[i]){
            for (int j = i * i; j <= n; j += i){
                f[j] = 0;
            }
        }
    }
    ll dem = 0;
    for (int y = 3; y <= sqrt(n - 4); y++){
        if (f[y]){
            z = y * y + 4;
            if (f[z]){
                cout << 2 << " " << y << " " << z << el;
                dem++;
            }
        }
    }
    if (dem == 0) cout << -1;
}
int main()
{
    tassk();
    solve();
    return 0;
}
