#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

const double EPS = 1e-8;
typedef long long ll;
typedef pair<int, int> pint;

ll gcd(ll a, ll b)
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	return gcd(b, a%b);
}

int n, d[10000], v[10000];
int main()
{
	while (scanf("%d", &n), n)
	{
		for (int i = 0; i < n; ++i)
			scanf("%d%d", d+i, v+i);

		int g;
		ll nume, deno;	// time
		g = gcd(d[0], v[0]);
		nume = d[0] / g;
		deno = v[0] / g;
		for (int i = 1; i < n; ++i)
		{
			g = gcd(d[i], v[i]);
			int td = d[i] / g;
			int tv = v[i] / g;
			nume *= td / gcd(nume, td);
			deno /= deno / gcd(deno, tv);
		}

		for (int i = 0; i < n; ++i)
			printf("%lld\n", (nume*v[i]/deno) / d[i]);
	}

	return 0;
}