#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;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgdGFzayAiRFBSSU1FMyIKI2RlZmluZSBsbCBsb25nIGxvbmcgaW50CiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgZWwgIlxuIgojZGVmaW5lIHZwbGwgdmVjdG9yPHBhaXI8bGwsIGxsPj4gCiNkZWZpbmUgdmxsIHZlY3Rvcjxsb25nIGxvbmc+CiNkZWZpbmUgcGlpIHBhaXI8aW50LCBpbnQ+CiNkZWZpbmUgcHFsbCBwcmlvcml0eV9xdWV1ZQpjb25zdCBsbCBOID0gMWU2ICsgMjsKY29uc3QgbGwgTU9EID0gMWU5ICsgNzsKY29uc3QgbGwgSU5GID0gMWU1OwpsbCBuLCB4LCB5LCB6Owp2ZWN0b3I8Ym9vbD4gZihNT0QsIDEpOwp2b2lkIHRhc3NrKCl7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwogICAgY2luLnRpZSgwKTsKICAgIGNvdXQudGllKDApOwogICAgaWYgKGZvcGVuKHRhc2siLmlucCIsInIiKSkKICAgIHsKICAgICAgICBmcmVvcGVuKHRhc2siLmlucCIsInIiLHN0ZGluKTsKICAgICAgICBmcmVvcGVuKHRhc2siLm91dCIsInciLHN0ZG91dCk7CiAgICB9Cn0Kdm9pZCBzb2x2ZSgpIHsKICAgIGZbMF0gPSBmWzFdID0gMDsKICAgIGNpbiA+PiBuOwogICAgZm9yIChpbnQgaSA9IDI7IGkgPD0gc3FydChuKTsgaSsrKXsKICAgICAgICBpZiAoZltpXSl7CiAgICAgICAgICAgIGZvciAoaW50IGogPSBpICogaTsgaiA8PSBuOyBqICs9IGkpewogICAgICAgICAgICAgICAgZltqXSA9IDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBsbCBkZW0gPSAwOwogICAgZm9yIChpbnQgeSA9IDM7IHkgPD0gc3FydChuIC0gNCk7IHkrKyl7CiAgICAgICAgaWYgKGZbeV0pewogICAgICAgICAgICB6ID0geSAqIHkgKyA0OwogICAgICAgICAgICBpZiAoZlt6XSl7CiAgICAgICAgICAgICAgICBjb3V0IDw8IDIgPDwgIiAiIDw8IHkgPDwgIiAiIDw8IHogPDwgZWw7CiAgICAgICAgICAgICAgICBkZW0rKzsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIGlmIChkZW0gPT0gMCkgY291dCA8PCAtMTsKfQppbnQgbWFpbigpCnsKICAgIHRhc3NrKCk7CiAgICBzb2x2ZSgpOwogICAgcmV0dXJuIDA7Cn0K