#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

typedef long long lint;

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

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

int main() {
	int n;
	
	while (cin >> n, n) {
		vector< lint > d(n), v(n);
		
		cin >> d[0] >> v[0];
		
		lint dd = d[0], vv = v[0];
		
		for_(i,1,n) {
			cin >> d[i] >> v[i];
			lint _lcm_ = lcm(d[i] * vv, v[i] * dd);
			dd = _lcm_ / v[i];
		}
		
		for_(i,0,n) cout << dd * v[i] / (vv * d[i]) << endl;
	}
}