#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

template<class T>
T gcd(T a, T b){
  if(a > b) swap(a,b);
  if(a == 0) return b;
  return gcd(a, b%a);
}

ll meet(int ad, int av, int bd, int bv){
  ll aa = (ll)ad * bv;
  ll bb = (ll)bd * av;
  return (aa * bb / gcd(aa, bb)) / aa;
}

int main(){
  int n;
  while(scanf("%d",&n), n){
    int d[n],v[n];
    ll ans = 1;
    scanf("%d%d",&d[0],&v[0]);
    REP(i, n-1){
      int bd, bv;
      ll tmp;
      scanf("%d%d",&d[i+1],&v[i+1]);
      tmp = meet(d[0], v[0], d[i+1], v[i+1]);
      ans = (ans * tmp) / gcd(ans, tmp);
    }
    //printf("ans = %d\n",ans);
    REP(i,n)
      printf("%d\n",(int)(ans*d[0]*v[i]/d[i]/v[0]));
  }
  return 0;
}