#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

int gcm();
int lcm();

// 最大公約数
ll gcm(ll a, ll b) {
	if (a < b) swap(a, b);
	if (b == 0) return 0;
	while (b) {
		a %= b;
		swap(a, b);
	}
	return a;
}

// 最小公倍数
ll lcm(ll a, ll b) {
	return a / gcm(a, b) * b;
}

// 約分
P reduction(P a) {
	ll g = gcm(a.first, a.second);

	a.first /= g;
	a.second /= g;

	return a;
}

int main() {
	int n;

	while (cin >> n, n) {
		vector<P> data;
		for (int i = 0; i < n; ++i) {
			int d, v; cin >> d >> v;
			data.push_back( P(d, v) );
		}

		// 約分
		for (int i = 0; i < n; ++i)
			data[i] = reduction(data[i]);

		// 時間計算
		P now = data[0];
		for (int i = 1; i < n; ++i) {
			P next = data[i];

			ll l = lcm(now.second, next.second);
			now.first *= l / now.second;
			next.first *= l / next.second;
			now.second = l;

			now.first = lcm(now.first, next.first);

			now = reduction(now);
		}

		// 出力
		for (int i = 0; i < n; ++i) {
			cout << (now.first * data[i].second / now.second / data[i].first) << endl;
		}
	}
}