#include <iostream>
using namespace std;

typedef long long int64;

int gcd(int a, int b) { return b == 0 ? a : gcd(b, a%b); }

int main() {
    int N; cin >> N;
    int64 last[N+1]; cin >> last[1];
    for ( int b=2; b<=N; ++b ) {
        int need; cin >> need;
        int64 lo = 1, hi = 1e18;
        while ( lo < hi ) {
            int64 mid = (lo+hi)/2;

            int64 got = mid / b;
            for ( int m=2; m<(1<<b); m+=2 ) {
                int64 minpos = mid;
                int lcm = b;
                int sign = 1;
                for ( int i=1; i<b; ++i ) {
                    if ( (m&(1<<i)) == 0 ) continue;
                    minpos = min(minpos, last[i]);
                    lcm = lcm * i / gcd(lcm, i);
                    sign = -sign;
                }
                got += sign * minpos / lcm;
            }

            if ( got >= need ) hi = mid;
            else lo = mid+1;
        }
        last[b] = lo;
    }

    for ( int b=1; b<=N; ++b ) cout << last[b] << "\n";

    return 0;
}
