#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int,int> P;
typedef std::pair<int,P> State;

const int INF = 1001001001;

// S N E W(南北東西)
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

int N;
ll d[10], v[10];

ll gcd(ll a, ll b){
    if(b == 0){return a;}
    return gcd(b, a%b);
}

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

int main(){
    while(std::cin >> N, N){
        REP(i, N){
            std::cin >> d[i] >> v[i];
        }

        ll c = lcm(d[0]*v[1], d[1]*v[0]) / d[0] / v[1];
        FOR(i, 2, N){
            c = lcm(d[0]*v[i]*c, d[i]*v[0]) / d[0] / v[i];
        }

        REP(i, N){
            printf("%lld\n", c * d[0] * v[i] / v[0] / d[i]);
        }
    }
}