#include <iostream>
#include <vector>
#include <utility>

using namespace std;

long long int gcd(long long int);
//long long int lcm(long long int, long long int);
pair<long long int, long long int> func(pair<long long int, long long int>, pair<long long int, long long int>);

int main(){
	int n;
	while (cin >> n, n) {
		vector<pair<long long int, long long int> > data;
		vector<long long int> p_lcm;
		for (int i = 0; i < n; i++) {
			int d, v; cin >> d >> v;
			data.push_back(make_pair((long long int)d, (long long int)v));
		}
		pair<long long int, long long int> cur = make_pair(data[0].first, data[0].second);
		for (int i = 1; i < data.size(); i++) {
			cur = func(cur, data[i]);
		}
		for (int i = 0; i < data.size(); i++) {
			cout << (cur.first * data[i].second) / (cur.second * data[i].first) << endl;	
		}
	}
	return 0;
}

long long int gcd(long long int a, long long int b){
	while (a != b) {
		if (a > b) {
			a = a - b;	
		} else {
			b = b - a;	
		}	
	}
	return a;
	/*
	if (a == b) return a;
	else {
		if (a > b) {
			return gcd(a - b, b);	
		} else {
			return gcd(b - a, a);	
		}	
	}
	*/
}

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

pair<long long int, long long int> func(pair<long long int, long long int> a, pair<long long int, long long int> b){
	long long int A = a.first * b.second, 
		   B = a.second * b.first;
	if (A == B) {
		if (a.second > b.second) {return make_pair(b.first, b.second);}
		else {return make_pair(a.first, a.second);}
	} else {
		if (a.second > b.second){
			return make_pair((A / gcd(A, B)) * b.first, b.second);	
		} else {
			return make_pair((B / gcd(A, B)) * a.first, a.second);	
		}
	}
}