#include <bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
 
ll n;
bool ada = false;

ll binexp(ll a, ll b){
    ll res = 1;
    while(b > 0){
        if(b & 1) res *= a;
        a *= a;
        b >>= 1;
    }
    return res;
}

int main() {
    fastio;
    cin >> n;
    for(ll i=1; i<=38; i++){
        for(ll j=1; j<=26; j++){
            if(binexp(3, i) + binexp(5, j) == n){
                cout << i << " " << j;
                ada = true;
                break;
            }
        }
    }
    if(!ada) cout << -1;
}

#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long
#define MOD 1000000007LL
#define MXN 10005
#define INF 1e9
#define EPS 1e-8
#define endl '\n'
#define lowbit(x) (x&-x)
using namespace std;

mt19937 gen(time(0));

ll n;
bool isprime[MXN];
bool v[MXN];
ll ans[MXN];
ll factor[] = {6,10,15};
vector<ll> prime;

void sieve(){
    for(ll i=2;i<=10000;i++){
        if(isprime[i])  continue;
        prime.push_back(i);
        for(ll j=i*i;j<=10000;j+=i){
            isprime[j]=1;
        }
    }
}

bool isfactor(ll x){
    for(int i=0;i<3;i++)    if(x%factor[i]==0)  return 1;
    return 0;
}

bool check(){
    ll gcd=ans[0];
    for(int i=0;i<n;i++){
        gcd=__gcd(gcd,ans[i]);
        if(ans[i]>10000)    return 0;
        if(ans[i]<=0)   return 0;
        if(v[ans[i]])   return 0;
        v[ans[i]]=1;
    }
    return gcd==1;
}
int main(){
    ios::sync_with_stdio(0);cin.tie(0);
    sieve();
    // cout<<prime.size()<<endl;
    // for(auto i:prime)   cout<<i<<" ";
    // cout<<endl;
    cin>>n;
    
    ans[0] = 6;
    ans[1] = 10;
    ans[2] = 15;
    ans[3] = 12;
    
    for(int i=4,j=16;i<n;i++,j++){
        while(!isfactor(j)){ j++; }
        ans[i]=j;
    }


    assert(check());
    for(int i=0;i<n;i++)    cout<<ans[i]<<" ";
    cout<<endl;

    return 0;
}

/*



*/