#include<cstdio>
#include<cmath>
using namespace std;
int k;
int fj(int q)
{
int r=0;
int i,j;
for(i=1;i<=sqrt(q);i++)
{
if(q%i==0)r++;
}
r=r*2;
if(sqrt(q)*sqrt(q)==q)
{
r--;
}
return r;
}
int main()
{
freopen("factor.in","r",stdin);
freopen("factor.out","w",stdout);
int i,z=0;
scanf("%d",&k);
for(i=1;i<=20000;i++)
{
if(fj(i)==k)
{
printf("%d",i);
z=1;
break;
}
}
if(z==0)printf("NO SOLUTION");
fclose(stdin);
fclose(stdout);
return 0;
}
#include<cmath>
using namespace std;
int k;
int fj(int q)
{
int r=0;
int i,j;
for(i=1;i<=sqrt(q);i++)
{
if(q%i==0)r++;
}
r=r*2;
if(sqrt(q)*sqrt(q)==q)
{
r--;
}
return r;
}
int main()
{
freopen("factor.in","r",stdin);
freopen("factor.out","w",stdout);
int i,z=0;
scanf("%d",&k);
for(i=1;i<=20000;i++)
{
if(fj(i)==k)
{
printf("%d",i);
z=1;
break;
}
}
if(z==0)printf("NO SOLUTION");
fclose(stdin);
fclose(stdout);
return 0;
}