#include<iostream>
using namespace std;
typedef long long ll;

ll gcd(ll a,ll b){return (!b)?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  ll n,d[10],v[10];
  while(cin >> n,n){
    for(int i=0;i<n;i++){
      cin >> d[i] >> v[i];
      ll tmp = gcd(d[i],v[i]);
      d[i]/=tmp; v[i]/=tmp;
    }

    ll ans[10];
    ans[0] = 1;

    for(int i=1;i<n;i++){
      ll x = v[i-1]*d[i], y = v[i]*d[i-1], tmp = gcd(x,y);
      x/=tmp; y/=tmp;      
      tmp = x/gcd(ans[i-1],x);
      for(int j=0;j<i;j++)ans[j] *= tmp;
      ans[i] = ans[i-1]/x*y;
    }

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