#include <stdio.h>

#define MYSCAN scanf

int gcd(int a, int b);

int main(void){
	int n;
	int d1, v1;
	double d[11] = { 0 };
	int v[11] = { 0 };
	int kouyaku;
	long long ans[11];

	while (true){

		MYSCAN("%d", &n);
		if (n == 0){ break; }

		// テ・ツ?・テ・ツ環崚」ツつ津・ツ渉療」ツ?妥・ツ渉姪」ツつ?
		for (int i = 0; i < n; i++){
			MYSCAN("%lf%d", &d[i], &v[i]);
		}

		// テヲツ?堙ァツ崢エテ」ツ?ォテ、ツスツ陛ゥツ?アテ」ツ?凖」ツつ古」ツ?ーテ」ツ?ィテ」ツつ甘」ツ?づ」ツ?暗」ツ?堙・ツ青古ァツ敖?」ツ?凖」ツつ凝」ツ?ョテ」ツ?凝ゥツ?妥・ツシツオテ」ツつ?
		for (int i = 0; i < n; i++){
			ans[i] = v[i];
			for (int j = 0; j < n; j++){
				if (i != j){
					ans[i] *= d[j];
				}
			}
		}
		
		// テァツュツ氾」ツ?暗」ツ?ョテヲツ慊?・ツ、ツァテ・ツ?ャテァツエツ?ヲツ閉ーテ」ツつ津ヲツアツづ」ツつ?」ツ?ヲテ」ツ??」ツ?敕」ツつ古」ツ?ァテ・ツ?ィテ、ツスツ禿」ツつ津・ツ可イテ」ツつ?
		kouyaku = ans[0];
		for (int i = 1;	i < n; i++){
			kouyaku = gcd(ans[i], kouyaku);
		}

		for (int i = 0; i < n; i++){
			ans[i] /= kouyaku;
			printf("%lld\n", ans[i]);
		}

	}	
	return 0;
}



int gcd(int a, int b){
	int c;
	if (b == 0) return a;
	c = a % b;
	return gcd(b, c);
}