#include <iostream>
using namespace std;
typedef long long ll;

#define lcm(a,b) (a / gcd(a,b) * b)

ll gcd(ll a,ll b){ return b ? gcd(b,a%b) : a; }
ll d[10],v[10],t[10];
int n;

ll w(ll arr[10]){
	ll ans = arr[0];
	for(int i = 1 ; i < n ; i++)
		ans = gcd(ans,arr[i]);
	return ans;
}
int main(){
	while(cin >> n , n){
		ll g = 1;
		for(int i = 0 ; i < n ; i++)
			cin >> d[i] >> v[i] ;
		ll p = w(d);
		ll q = w(v);
		for(int i = 0 ; i < n ; i++){
			d[i] /= p;
			v[i] /= q;
		}
		for(int i = 0 ; i < n ; i++){
			long long a = v[i];
			for(int j = 0 ; j < n ; j++){
				if(i==j) continue;
				a *= d[j];
			}
			t[i] = a;
		}
		ll r = w(t);
		for(int i = 0 ; i < n ; i++)
			cout << t[i]/r << endl;
	}
}