#include <vector>
#include <iostream>
using namespace std;
long long gcd(long long x, long long y){
  if(y > x) swap(x,y);
  if(!y) return x;
  return gcd(y, x%y);
}
              
int main(){
  int n;
  while(cin >> n, n){
    vector<long long> D(n), V(n);
    for(int i = 0; i < n; ++i) cin >> D[i] >> V[i];
    vector<long long> ans(n, 1);
    long long d_ = D[0], v_ = V[0];
    for(int i = 1; i < n; ++i){
      long long d = D[i], v = V[i], g = gcd(v*d_, v_*d);
      ans[i] = d_*v/g;
      for(int j = 0; j < i; ++j){
        ans[j] *= d*v_/g;
      }
      d_ *= d*v_/g;
    }
    for(int i = 0; i < n; ++i) cout << ans[i] << endl;
  }
  return 0;
}

