#include <algorithm>
#include <vector>
#include <string>

#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long llint;

int n;
llint doseg[ 11 ];

llint praznih( llint L, int D )
{
    llint suma = 0;

    for( int mask = 0; mask < (1<<(D-1)); ++mask ) {
        llint lcm = D;
        llint kraj = L;

        for( int i = 1; i < D; ++i )
            if( mask >> (i-1) & 1 ) {
                lcm = lcm / __gcd( lcm, i*1LL ) * i;
                kraj = min( kraj, doseg[i] );
            }

        if( __builtin_popcount( mask ) & 1 )
            suma -= kraj / lcm;
        else
            suma += kraj / lcm;
    }

    return suma;
}

int main( void )
{
    scanf( "%d", &n );

    for( int i = 1; i <= n; ++i ) {
        llint zaba; scanf( "%lld", &zaba );
        llint lo = 0, hi = 1000000000000000LL;

        while( lo < hi ) {
            llint mid = ( lo + hi ) / 2;

            if( praznih( mid, i ) >= zaba )
                hi = mid;
            else
                lo = mid + 1;
        }

        doseg[i] = lo;
        printf( "%lld\n", lo );
    }

    return 0;
}

