#include <iostream>
#include <vector>

using namespace std;

long int gcd(long int m,long int n){
    if ( ( 0 == m ) || ( 0 == n ) )
        return 0;
    while( m != n )
    {
        if ( m > n ) m = m - n;
        else         n = n - m;
    }
    return m;
}
long int lcm(long int m,long int n)
{
    if ( ( 0 == m ) || ( 0 == n ) )
        return 0;
    return ((m / gcd(m, n)) * n);
}

int main() {
    long int d,v,n;
    while (cin >> n) {
        if(n==0) break;
        vector<pair<long int,long int> > data;
        vector<pair<long int,long int> >::iterator it;
        for (int i=0; i<n; i++) {
            cin >> d >> v;
            pair<long int, long int> a(d,v);
            data.push_back(a);
        }
        
        long int v_1,result;
        it = data.begin();
        v_1 = it->second;
        it++;
        result = it->second;
        while(1){
            result = lcm(v_1, result);
            it++;
            if(it == data.end()) break;
            v_1 = it->second;
        }
        
        vector<long int> res;
        vector<long int>::iterator it_res;
        it = data.begin();
        while (it != data.end()) {
            res.push_back(it->first * (result/it->second));
            it++;
        }
        it_res = res.begin();
        v_1 = *it_res;
        it_res++;
        result = *it_res;
        while(1){
            result = lcm(v_1, result);
            it_res++;
            if(it_res == res.end()) break;
            v_1 = *it_res;
        }
        
        it_res = res.begin();
        while (it_res != res.end()) {
            cout << result /(*it_res) << endl;
            it_res++;
        }
    }
}