#include <cstdio>
#include <algorithm>
#include <cstring>
#include <iostream>
#define UP 2000000000L
#define MAX 160007

using namespace std;

typedef long long LL;

LL num[MAX];
int cnt = 1;

void init ( )
{
    LL temp1 = 1 , temp2 = 1 , temp3 = 1 , temp4 = 1;
    while ( temp1 <= UP )
    {
        temp2 = 1;
        while ( temp2 <= UP )
        {
            temp3 = 1;
            if ( temp1 * temp2 > UP ) break;
            while ( temp3 <= UP )
            {
                if ( temp1 * temp2 * temp3 > UP ) break;
                temp4 = 1;
                while ( temp4 <= UP )
                {
                    if ( temp1 * temp2 * temp3 * temp4 > UP ) break;
                    num[cnt++] = temp1 * temp2 * temp3 * temp4;
                    temp4 *= 2;
                }
                temp3 *= 3;
            }
            temp2 *= 5;
        }
        temp1 *= 7;
    }
    sort ( num+1 , num + cnt ); 
}

int main ( )
{
    int n;
    init ( );
    while ( ~scanf ( "%d" , &n ), n  )
    {
        char s[50];
        if ( (n/10)%10 != 1 )
        {
            if ( n%10 == 1 ) sscanf ( "st" , "%s" , s );
            else if ( n%10 == 2 ) sscanf ( "nd" , "%s" , s );
            else if ( n%10 == 3 ) sscanf ( "rd" , "%s" , s );
            else sscanf ( "th" , "%s" , s );
        }
        else  sscanf ( "th" , "%s" , s );
        printf ( "The %d%s humble number is %lld.\n" , n , s ,num[n] ); 
    }
}