#include<bits/stdc++.h>

using namespace std;

int N;
int Distance[10], Speed[10];
unsigned long long Lcm[10][10];


unsigned long long findLcm(unsigned long long nowA, unsigned long long nowB) {
	unsigned long long a, b;

	a = nowA;
	b = nowB;
	while (b ^= a ^= b ^= (a %= b));
	
	return (nowA / a) * nowB;
}

void solve() {
	int k;
	unsigned long long nowLcm;

	for (int i = 0; i < N; ++i) {
		k = 0;
		for (int j = 0; j < N; ++j) {
			if (i == j) {
				continue;
			}
			nowLcm = findLcm(Distance[i] * Speed[j], Distance[j] * Speed[i]);
			Lcm[i][k++] = nowLcm / (Distance[i] * Speed[j]);
		}
	}

	for (int i = 0; i < N; ++i) {
		for (int j = 1; j < N - 1; ++j) {
			Lcm[i][0] = findLcm(Lcm[i][0], Lcm[i][j]);
		}
	}

	for (int i = 0; i < N; ++i) {
		cout << Lcm[i][0] << endl;
	}
}

int main() {

	while (cin >> N, N) {
		memset(Distance, 0, sizeof(Distance));
		memset(Speed, 0, sizeof(Speed));
		memset(Lcm, 0, sizeof(Lcm));
		for (int i = 0; i < N; ++i) {
			cin >> Distance[i] >> Speed[i];
		}
		////show:
		//for (int i = 0; i < N; ++i) {
		//	cout << Distance[i] << " " << Speed[i] << endl;
		//}
		solve();
	}

	return 0;
}
