#include <iostream>
 
using namespace std;

long long lcm(long long a,long long b) {
	long long c;
	if (a<b) { c=a; a=b; b=c;}
	while(a % b!=0) {c=a; a=b; b=c % b;}
	return b;
}

int main() {
	long long d[10],v[10],a,c,e,f;
	int i,n;
	while(cin >> n && n>0) {
		for (i=0;i<n;i++) cin >> d[i] >> v[i];
		e=d[0]; f=v[0];
		for (i=1;i<n;i++) {
			c=lcm(f*d[i],e*v[i]);
			a=e*v[i]/c;
			e=a*d[i]; f=v[i];
			};
		for (i=0;i<n;i++) cout << (e*v[i])/(f*d[i]) << endl;
	} 
	return 0;
}