#include <iostream>
#include <vector>

using namespace std;

int main() {
    int t;
    cin >> t;
    for (int q = 0; q < t; q++) {
        int m;
        int n;
        cin >> n >> m;
        if (n > 2) {
            cout << m*2;
        } else {
            if (n==2){
                cout << m;
            }
            else{
            cout << 0;}
        }
        cout << '\n';
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
    int t;
    cin >> t;
    for (int q = 0; q < t; q++) {
        double m;
        int n;
        cin >> n >> m;
        if (n != 1) {
            double s = m / (n / 2);
            s = s * (n - 1);
            cout << s;
        } else {
            cout << 0;
        }
        cout << '\n';
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
int main() {
    int t;
    cin >> t;
    for (int q = 0; q < t; q++){
       float m;
       int n;
       cin >> n >> m;
       float s=m/(n/2);
       s=s*(n-1);
       cout << s;
        cout << '\n';
    }
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n,m;
        cin>>n>>m;
        if(n==1)
        {
            cout<<"0"<<endl;
            continue;
        }
        if(n==2)
        {
            cout<<m<<endl;
            continue;
        }
        cout<<m*2<<endl;
    }
}


#include <iostream>
#include <algorithm>

using namespace std;

//Problem A

int main()
{
    int T, N, M;
    cin >> T;
    for (int t=1; t<=T; t++){
        cin >> N >> M;
        if (N==2){
            cout << M << endl;
        }
        else{
            cout << 2*M << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

//Problem A

int main()
{
    int T, N, M;
    cin >> T;
    for (int t=1; t<=T; t++){
        cin >> N >> M;
        if (N==1){
            cout << 0 << endl;
        }
        else if (N==2){
            cout << M << endl;
        }
        else{
            cout << 2*M << endl;
        }
    }
    return 0;
}


         #include <iostream>
using namespace std;

void do_1(){
    int n, m;
    cin >> n >> m;

    if (n == 1) {
        cout << 0 << " ";
    } else if (n == 2) {
        cout << m << " ";
    } else {
        cout << 2 * m << " ";
    }
}

int main ()
{
    int n;
    cin >> n;

    for (int i = 0; i < n; i++) {
        do_1();
    }
}


#include <iostream>
#include<vector>
#include <algorithm>
#include<string>
#include <set>
using namespace std;
void solve() {
	int n;
	cin >> n;
	int m;
	cin >> m;
	if (n <= 1) {
		cout << "0"<<endl;
	}
	else if (n == 2 || n == 3) {
		cout << m << endl;
	}
	else if (n == 4) {
		if (m % 2 == 0) {
			cout << m + (m / 2);
		}
		else {
			cout << m + (m / 2) + 1;
		}
	}
	else if (n >= 5) {
		cout << 2 * m << endl;
	}

}

int main() {
	int t; cin >> t;
	while (t--)
		solve();
}


#include <iostream>
#include<vector>
#include <algorithm>
#include<string>
#include <set>
using namespace std;
void solve() {
	int n;
	cin >> n;
	int m;
	cin >> m;
	if (n <= 1) {
		cout << "0" << endl;
	}
	else if (n == 2) {
		cout << m << endl;
	}

	else if (n >= 3) {
		cout << 2 * m << endl;
	}

}

int main() {
	int t; cin >> t;
	while (t--)
		solve();
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;

// answer : [0,m,0,…,0]

void solve(int n, int m)
{
	if (n==1)
	{
		cout << 0 << endl;
	}
	else if (n==2)
	{
		cout << m << endl;
	}
	else
	{
		cout << 2*m << endl;
	}
}

int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
	ifstream in("inputA.txt");
	cin.rdbuf(in.rdbuf()); //redirect cin to input.txt!
	ofstream out("outA.txt");
	cout.rdbuf(out.rdbuf()); //redirect cout to out.txt!
#endif

	int t;
	cin >> t;
	while (t--)
	{
		int n, m;
		cin >> n >> m;
		solve(n, m);
	}
	return 0;
}


#include<stdio.h>
#include<string.h>

int main()
{
	int t;
	long long a,b;
	scanf("%d",&t);
	while(t--){
	scanf("%lld",&a);
	scanf("%lld",&b);
	if(a==1) printf("0\n");
	else if(a==2) printf("%lld\n",b);
	else printf("%lld\n",2*b);
	}
return 0;
}


#include<stdio.h>
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	long long a,b;
	scanf("%d",&t);
	while(t--){
	scanf("%lld",&a);
	scanf("%lld",&b);
	if(a==1) printf("0\n");
	else if(a==2) printf("%lld",b);
	else printf("%lld",2*b);
	}
return 0;
}


#include<stdio.h>

int main()
{
	int t;
	long long a,b;
	scanf("%d",&t);
	while(t--){
	scanf("%lld",&a);
	scanf("%lld",&b);
	if(a==1) printf("0\n");
	else if(a==2) printf("%lld",b);
	else printf("%lld",2*b);
	}
return 0;
}


// MostUnstableArray.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

using namespace std;

int main()
{
	unsigned count;
	scanf_s("%u", &count);

	unsigned long* results = new unsigned long[count];

	for (int i = 0; i < count; i++) {
		unsigned long arrLength, arrSum;
		scanf_s("%lu %lu", &arrLength, &arrSum);

		if (arrLength == 1) {
			results[i] = 0;
		}
		else if (arrLength == 2) {
			results[i] = arrSum;
		}
		else {
			results[i] = 2 * arrSum;
		}

	}

	for (int i = 0; i < count; i++)
		printf("%lu\n", results[i]);
}


// MostUnstableArray.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

using namespace std;

int main()
{
	unsigned count;
	scanf_s("%u", &count);

	for (int i = 0; i < count; i++) {
		unsigned long arrLength, arrSum;
		scanf_s("%lu %lu", &arrLength, &arrSum);

		if (arrLength == 1) {
			printf("%lu", 0);
		}
		else if (arrLength == 2) {
			printf("%lu", arrSum);
		}
		else if (arrSum <= arrLength / 2) {
			printf("%lu", arrSum * 2 - 1);
		}
		else {
			printf("%lu", 2 * arrSum);
		}

	}
}


// MostUnstableArray.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

using namespace std;

int main()
{
	unsigned count;
	scanf_s("%u", &count);

	unsigned long* results = new unsigned long[count];

	for (int i = 0; i < count; i++) {
		unsigned long arrLength, arrSum;
		scanf_s("%lu %lu", &arrLength, &arrSum);

		if (arrLength == 1) {
			results[i] = 0;
		}
		else if (arrLength == 2) {
			results[i] = arrSum;
		}
		else if (arrSum <= arrLength / 2) {
			results[i] = arrSum * 2 - 1;
		}
		else {
			results[i] = 2 * arrSum;
		}

	}

	for (int i = 0; i < count; i++)
		printf("%lu\n", results[i]);
}


// MostUnstableArray.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

using namespace std;

int main()
{
	unsigned count;
	scanf_s("%u", &count);

	unsigned long* results = new unsigned long[count];

	for (int i = 0; i < count; i++) {
		unsigned long arrLength, arrSum;
		scanf_s("%lu %lu", &arrLength, &arrSum);

		if (arrLength == 1) {
			results[i] = 0;
		}
		else if (arrLength == 2) {
			results[i] = arrSum;
		}
		else {
			results[i] = 2 * arrSum;
		}

	}

	for (int i = 0; i < count; i++)
		printf("%lu", results[i]);
}


#include <iostream>
using namespace std;

void main()
{
	int t;
	cin >> t;
	int n;
	int m;
	int* ans = new int[t];
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		cin >> m;
		if (n == 1)
		{
			ans[i] == 0;
		}
		else if (n == 2)
		{
			ans[i] == m;
		}
		else
		{
			ans[i] == m * 2;
		}

	}

	for (int i = 0; i < t; i++)
	{
		cout << ans[i];
		if (i != t - 1)
			cout << endl;
	}
}


#include <iostream>
using namespace std;

void main()
{
	int t;
	cin >> t;
	int n;
	int m;
	int* ans = new int[t];
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		cin >> m;
		if (n == 1)
		{
			ans[i] = 0;
		}
		else if (n == 2)
		{
			ans[i] = m;
		}
		else
		{
			ans[i] = m * 2;
		}

	}

	for (int i = 0; i < t; i++)
	{
		cout << ans[i];
		if (i != t - 1)
			cout << endl;
	}
}


#include <iostream>
using namespace std;

void main()
{
	int t;
	cin >> t;
	int n;
	int m;
	int* ans = new int[t];
	for (int i = 0; i < t; i++)
	{
		cin >> n >> m;
		int val;
		if (n == 1)
		{
			val = 0;
		}
		else if (n == 2)
		{
			val == m;
		}
		else
		{
			val == m * 2;
		}
		ans[i] = val;
	}

	for (int i = 0; i < t; i++)
	{
		cout << ans[i];
		if (i != t - 1)
			cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <utility>
#include <set>
#include <deque>
#include <list>

using namespace std;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n, m;
        cin >> n >> m;
        if (n == 1)
        {
            cout << 0 << endl;
            continue;
        }
        if (n == 2)
        {
            cout << m << endl;
            continue;
        }
        /*if (n == 3)
        {
            cout << m * 2 << endl;
            continue;
        }*/
       /* if (n == 4)
        {
            cout << (m - 1) * 2 + 1 << endl;
            continue;
        }*/
        cout << m * 2 << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <utility>
#include <set>
#include <deque>
#include <list>

using namespace std;

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n, m;
        cin >> n >> m;
        if (n == 1)
        {
            cout << 0 << endl;
            continue;
        }
        if (n == 2)
        {
            cout << m << endl;
            continue;
        }
        if (n == 3)
        {
            cout << m * 2 << endl;
            continue;
        }
        if (n == 4)
        {
            cout << (m - 1) * 2 + 1 << endl;
            continue;
        }
        cout << (m - 1) * 2 + 2 << endl;
    }
    return 0;
}


#include <iostream>

int main()
{
	using namespace std;
	long long int n, m, t;
	cin >> t;
	while (t-- > 0)
	{
		cin >> n >> m;
		if (n == 1)
			cout << 0 << endl;
		else if (n <= 3)
			cout << m << endl;
		else if (n == m)
			cout << n * 2 << endl;
		else
			cout << (n / 2) * m << endl;
	}
	return 0;
}


#include <iostream>

int main()
{
	using namespace std;
	long long int n, m, t;
	cin >> t;
	while (t-- > 0)
	{
		cin >> n >> m;
		if (n == 1)
			cout << 0 << endl;
		if (n < 3)
			cout << m << endl;
		else if (n == m)
			cout << n * 2 << endl;
		else
			cout << (n / 2) * m << endl;
	}
	return 0;
}


#include <iostream>

int main()
{
	using namespace std;
	long long int n, m, t;
	cin >> t;
	while (t-- > 0)
	{
		cin >> n >> m;
		if (n == 1)
			cout << 0 << endl;
		else if (n < 3)
			cout << m << endl;
		else if (n == m)
			cout << n * 2 << endl;
		else
			cout << (n / 2) * m << endl;
	}
	return 0;
}


#include <iostream>

int main()
{
	using namespace std;
	long long int n, m, t;
	cin >> t;
	while (t-- > 0)
	{
		cin >> n >> m;
		if (n == 1)
			cout << 0 << endl;
		else if (n == 2)
			cout << m << endl;
		else
			cout << m * 2 << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define x first
#define y second
#pragma GCC optimize(2)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("sse3","sse2","sse")
#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#pragma GCC diagnostic error "-std=c++14"
#define IOS ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef long long LL;
const int N=1010;
const int M=1e6;
const int INF=0x3f3f3f3f;
const int MOD=1000000007;
LL g[N][N];
LL ans[N];
LL gcd(LL x ,LL y){
    return y==0 ? x : gcd(y,x%y);
}
int main()
{
    IOS;
    int n;cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>g[i][j];
        }
    }
    for(int i=0;i<n;i++){
        LL t=0;
        for(int j=0;j<n;j++){
            t=gcd(t,g[j][i]);
        }
        ans[i]=t;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(i==j) continue;
            while(ans[i]*ans[j]!=g[i][j]){
                if(ans[i]>ans[j] &&g[i][j]<= (ans[i]*ans[j])) ans[i]/=(ans[i]*ans[j]/g[i][j]);
                else if(ans[i]>ans[j] &&g[i][j] > (ans[i]*ans[j])) ans[i]*=(g[i][j]/(ans[i]*ans[j]));
                else if(ans[i]<=ans[j] && g[i][j]<= (ans[i]*ans[j])) ans[j]/=(ans[i]*ans[j]/g[i][j]);
                else if(ans[i]<=ans[j] &&g[i][j] > (ans[i]*ans[j])) ans[j]*=(g[i][j]/(ans[i]*ans[j]));
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<' ';
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define x first
#define y second
#pragma GCC optimize(2)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("sse3","sse2","sse")
#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#pragma GCC diagnostic error "-std=c++14"
#define IOS ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef long long LL;
const int N=1010;
const int M=1e6;
const int INF=0x3f3f3f3f;
const int MOD=1000000007;
LL g[N][N];
LL ans[N];
LL gcd(LL x ,LL y){
    return y==0 ? x : gcd(y,x%y);
}
int main()
{
    IOS;
    int n;cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>g[i][j];
        }
    }
    for(int i=0;i<n;i++){
        LL t=0;
        for(int j=0;j<n;j++){
            t=gcd(t,g[j][i]);
        }
        ans[i]=t;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(i==j) continue;
            while(ans[i]*ans[j]!=g[i][j]){
                ans[i]/=(ans[i]*ans[j]/g[i][j]);
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<' ';
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define x first
#define y second
#pragma GCC optimize(2)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("sse3","sse2","sse")
#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#pragma GCC diagnostic error "-std=c++14"
#define IOS ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef long long LL;
const int N=1010;
const int M=1e6;
const int INF=0x3f3f3f3f;
const int MOD=1000000007;
LL g[N][N];
LL ans[N];
LL gcd(LL x ,LL y){
    return y==0 ? x : gcd(y,x%y);
}
int main()
{
    IOS;
    int n;cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>g[i][j];
        }
    }
    for(int i=0;i<n;i++){
        LL t=0;
        for(int j=0;j<n;j++){
            t=gcd(t,g[j][i]);
        }
        ans[i]=t;
    }
    bool fg=0;
    for(int i=0;i<n-1;i++){
        if(ans[i]!=ans[i+1]) fg=1;
    }
    if(!fg){
        for(int i=0;i<n;i++){
            ans[i]=sqrt(ans[i]);
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(i==j) continue;
            while(ans[i]*ans[j]!=g[i][j]){
                if(ans[i]>=ans[j] &&g[i][j]<= (ans[i]*ans[j])) ans[i]/=(ans[i]*ans[j]/g[i][j]);
                else if(ans[i]>=ans[j] &&g[i][j] > (ans[i]*ans[j])) ans[i]*=(g[i][j]/(ans[i]*ans[j]));
                else if(ans[i]<ans[j] && g[i][j]<= (ans[i]*ans[j])) ans[j]/=(ans[i]*ans[j]/g[i][j]);
                else if(ans[i]<ans[j] &&g[i][j] > (ans[i]*ans[j])) ans[j]*=(g[i][j]/(ans[i]*ans[j]));
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<' ';
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define x first
#define y second
#pragma GCC optimize(2)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("sse3","sse2","sse")
#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#pragma GCC diagnostic error "-std=c++14"
#define IOS ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef long long LL;
const int N=1010;
const int M=1e6;
const int INF=0x3f3f3f3f;
const int MOD=1000000007;
LL g[N][N];
LL ans[N];
LL gcd(LL x ,LL y){
    return y==0 ? x : gcd(y,x%y);
}
int main()
{
    IOS;
    int n;cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>g[i][j];
        }
    }
    for(int i=0;i<n;i++){
        LL t=0;
        for(int j=0;j<n;j++){
            t=gcd(t,g[j][i]);
        }
        ans[i]=t;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(i==j) continue;
            while(ans[i]*ans[j]!=g[i][j]){
                if(ans[i]>ans[j]) ans[i]/=((ans[i]*ans[j])/g[i][j]);
                else if(ans[j]>=ans[i]) ans[j]/=((ans[i]*ans[j])/g[i][j]);
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<' ';
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define x first
#define y second
#pragma GCC optimize(2)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("sse3","sse2","sse")
#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#pragma GCC diagnostic error "-std=c++14"
#define IOS ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef long long LL;
const int N=1010;
const int M=1e6;
const int INF=0x3f3f3f3f;
const int MOD=1000000007;
LL g[N][N];
LL ans[N];
LL gcd(LL x ,LL y){
    return y==0 ? x : gcd(y,x%y);
}
int main()
{
    IOS;
    int n;cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>g[i][j];
        }
    }
    for(int i=0;i<n;i++){
        LL t=0;
        for(int j=0;j<n;j++){
            t=gcd(t,g[j][i]);
        }
        ans[i]=t;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(i==j) continue;
            while(ans[i]*ans[j]!=g[i][j]){
                if(ans[i]>=ans[j] &&g[i][j]<= (ans[i]*ans[j])) ans[i]/=(ans[i]*ans[j]/g[i][j]);
                else if(ans[i]>=ans[j] &&g[i][j] > (ans[i]*ans[j])) ans[i]*=(g[i][j]/(ans[i]*ans[j]));
                else if(ans[i]<ans[j] && g[i][j]<= (ans[i]*ans[j])) ans[j]/=(ans[i]*ans[j]/g[i][j]);
                else if(ans[i]<ans[j] &&g[i][j] > (ans[i]*ans[j])) ans[j]*=(g[i][j]/(ans[i]*ans[j]));
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<' ';
    }
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;

typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<double> vd;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<int, pii>> vpiii;

typedef map<string, string> mss;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, ll> mill;
typedef map<int, vpii> mivpii;

void fast_io() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

int gcd_col(vvi &grid, int x) {
	int ans = 0, len = grid.size();
	for(int i = 0; i < len; i++)
		ans = __gcd(ans, grid[i][x]);
	return ans;
}

int gcd_row(vvi &grid, int x) {
	int ans = 0, len = grid.size();
	for(int i = 0; i < len; i++)
		ans = __gcd(ans, grid[x][i]);
	return ans;
}

int main() {
	fast_io();
//	freopen("input/1220B.txt", "r", stdin);

	int n;
	cin >> n;

	vvi grid(n, vi(n));
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++)
			cin >> grid[i][j];
	}

	vi row(n), col(n);
	for(int i = 0; i < n; i++) {
		col[i] = gcd_col(grid, i);
		row[i] = gcd_row(grid, i);
	}

	for(int i = 0; i < n; i++) {
		cout << col[i] * row[i] << ' ';
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;

typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<double> vd;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<int, pii>> vpiii;

typedef map<string, string> mss;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, ll> mill;
typedef map<int, vpii> mivpii;

void fast_io() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

int gcd_col(vvi &grid, int x) {
	int ans = 0, len = grid.size();
	for(int i = 0; i < len; i++)
		ans = __gcd(ans, grid[i][x]);
	return ans;
}

ll left(vvll &grid, int i) {
	return (grid[i][i + 1] * grid[i][i + 2]) / (grid[i + 1][i + 2]);
}

ll right(vvll &grid, int i) {
	return (grid[i][i - 1] * grid[i][i - 2]) / (grid[i - 1][i - 2]);
}

ll middle(vvll &grid, int i) {
	return (grid[i][i - 1] * grid[i][i + 1]) / (grid[i + 1][i - 1]);
}

int main() {
	fast_io();
//	freopen("input/1220B.txt", "r", stdin);

	int n;
	cin >> n;

	vvll grid(n, vll(n));
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++)
			cin >> grid[i][j];
	}

	ll ans;
	for(int i = 0; i < n; i++) {
		if(i == 0) ans =  left(grid, i);
		else if(i == n - 1) ans =  right(grid, i);
		else ans = middle(grid, i);
		cout << (ll) sqrt(ans) << ' ';
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;

typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<double> vd;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<int, pii>> vpiii;

typedef map<string, string> mss;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, ll> mill;
typedef map<int, vpii> mivpii;

void fast_io() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

int gcd_col(vvi &grid, int x) {
	int ans = 0, len = grid.size();
	for(int i = 0; i < len; i++)
		ans = __gcd(ans, grid[i][x]);
	return ans;
}

int gcd_row(vvi &grid, int x) {
	int ans = 0, len = grid.size();
	for(int i = 0; i < len; i++)
		ans = __gcd(ans, grid[x][i]);
	return ans;
}

int main() {
	fast_io();
//	freopen("input/1220B.txt", "r", stdin);

	int n;
	cin >> n;

	vvi grid(n, vi(n));
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++)
			cin >> grid[i][j];
	}

	vi row(n), col(n);
	for(int i = 0; i < n; i++) {
		col[i] = gcd_col(grid, i);
		row[i] = gcd_row(grid, i);
	}

	for(int i = 0; i < n; i++) {
		cout << __gcd(col[i], row[i]) << ' ';
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;

typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<double> vd;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<int, pii>> vpiii;

typedef map<string, string> mss;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, ll> mill;
typedef map<int, vpii> mivpii;

const int MAX = 1000000;

void fast_io() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

bool p_square(ll x) {
	return ceil(sqrt(x)) == floor(sqrt(x));
}

bool prime(ll x) {
	if(x == 1) return false;
	int s = sqrt(x);
	for(int i = 2; i <= sqrt(s); i++)
		if(s % i == 0) return false;

	return true;
}

int main() {
	fast_io();
//	freopen("input/230B.txt", "r", stdin);

	int n;
	ll x;

	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> x;
		cout << ((p_square(x) and prime(x)) ? "YES" : "NO") << '\n';
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;

typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<double> vd;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<int, pii>> vpiii;

typedef map<string, string> mss;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, ll> mill;
typedef map<int, vpii> mivpii;

void fast_io() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

ll left(vvll &grid, int i) {
	return (grid[i][i + 1] * grid[i][i + 2]) / (grid[i + 1][i + 2]);
}

ll right(vvll &grid, int i) {
	return (grid[i][i - 1] * grid[i][i - 2]) / (grid[i - 1][i - 2]);
}

ll middle(vvll &grid, int i) {
	return (grid[i][i - 1] * grid[i][i + 1]) / (grid[i - 1][i + 1]);
}

int main() {
	fast_io();
//	freopen("input/1220B.txt", "r", stdin);

	int n;
	ll ans;
	cin >> n;

	vvll grid(n, vll(n));
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++)
			cin >> grid[i][j];
	}

	for(int i = 0; i < n; i++) {
		if(i == 0) ans =  left(grid, i);
		else if(i == n - 1) ans =  right(grid, i);
		else ans = middle(grid, i);
		cout << (ll) sqrt(ans) << ' ';
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<string, string> ss;
typedef pair<int, ss> iss;

typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef vector<double> vd;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<int, pii>> vpiii;

typedef map<string, string> mss;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, ll> mill;
typedef map<int, vpii> mivpii;

void fast_io() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
}

int gcd_col(vvi &grid, int x) {
	int ans = 0, len = grid.size();
	for(int i = 0; i < len; i++)
		ans = __gcd(ans, grid[i][x]);
	return ans;
}

ll left(vvll &grid, int i) {
	return (grid[i][i + 1] * grid[i][i + 2]) / (grid[i + 1][i + 2]);
}

ll right(vvll &grid, int i) {
	return (grid[i][i - 1] * grid[i][i - 2]) / (grid[i - 1][i - 2]);
}

ll middle(vvll &grid, int i) {
	return (grid[i][i - 1] * grid[i][i + 1]) / (grid[i + 1][i - 1]);
}

int main() {
	fast_io();
//	freopen("input/1220B.txt", "r", stdin);

	int n;
	cin >> n;

	vvll grid(n, vll(n));
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++)
			cin >> grid[i][j];
	}

	ll ans;
	for(int i = 0; i < n; i++) {
		if(i == 0) ans =  left(grid, i);
		else if(i == n - 1) ans =  right(grid, i);
		else ans = middle(grid, i);
		cout << sqrt(ans) << ' ';
	}

	return 0;
}


#include <bits/stdc++.h>
#define I int64_t
#define M 1000000007
using namespace std;
I A[1002][1002];

int main() {
    //freopen("in.txt", "r", stdin);
    int aa = 325017, bb=20097, cc = 13601;
    auto f = 1.f* aa / bb;
    auto m = 1.f*cc;
    cout << m * f << endl;
    cout << sqrt(f * m) << endl;
    return 0;
    int n;
    cin>>n;
    for (int i=0; i< n; i++)
        for (int j=0; j< n; j++)
            scanf("%ld", &A[i][j]);

    int a[1001];
    for (int i=1; i<n-1; i++)
    {
        auto f = 1.f* A[i][0] / A[i+1][0];
        auto m = 1.f*A[i][i+1];
        a[i] = sqrt(m * f);
    }
    a[0] = A[0][1] / a[1];
    a[n-1] = A[0][n-1]/a[0];
    for (int i=0; i< n; i++)
        printf("%d ", a[i]);

}


#include <bits/stdc++.h>
#define I int64_t
#define M 1000000007
using namespace std;
int A[1002][1002];

int sqrt1(int a) {
    int s = sqrt(a);
    if ((s - 1 ) * (s - 1) == a)
        return s-1;
    if ((s + 1 ) * (s + 1) == a)
        return s+1;
    return s;
}

int main() {
    //freopen("in.txt", "r", stdin);

    int n;
    cin>>n;
    for (int i=0; i< n; i++)
        for (int j=0; j< n; j++)
            scanf("%d", &A[i][j]);

    int a[1001];
    for (int i=1; i<n-1; i++)
    {
        auto f = 1.f* A[i][0] / A[i+1][0];
        auto m = 1.f*A[i][i+1];
        a[i] = sqrt1(m * f);

    }
    a[0] = A[0][1] / a[1];
    a[n-1] = A[0][n-1]/a[0];
    for (int i=0; i< n; i++)
        printf("%d ", a[i]);

}


#include <bits/stdc++.h>
#define I int64_t
#define M 1000000007
using namespace std;
double A[1002][1002];

int main() {
    //freopen("in.txt", "r", stdin);

    int n;
    cin>>n;
    for (int i=0; i< n; i++)
        for (int j=0; j< n; j++)
            scanf("%lf", &A[i][j]);

    int a[1001];
    for (int i=1; i<n-1; i++)
    {
        auto f = A[i][0] / A[i+1][0];
        auto m = A[i][i+1];
        a[i] = sqrt(m * f);
    }
    a[0] = A[0][1] / a[1];
    a[n-1] = A[0][n-1]/a[0];
    for (int i=0; i< n; i++)
        printf("%d ", a[i]);

}


#include <bits/stdc++.h>
#define I int64_t
#define M 1000000007
using namespace std;
double A[1002][1002];

int sqrt1(int a) {
    int s = sqrt(a);
    if ((s - 1 ) * (s - 1) == a)
        return s-1;
    if ((s + 1 ) * (s + 1) == a)
        return s+1;
    return s;
}

int main() {
    //freopen("in.txt", "r", stdin);

    int n;
    cin>>n;
    for (int i=0; i< n; i++)
        for (int j=0; j< n; j++)
            scanf("%lf", &A[i][j]);

    int a[1001];
    for (int i=1; i<n-1; i++)
    {
        auto f = 1.f* A[i][0] / A[i+1][0];
        auto m = 1.f*A[i][i+1];
        a[i] = sqrt1(m * f);
    }
    a[0] = A[0][1] / a[1];
    a[n-1] = A[0][n-1]/a[0];
    for (int i=0; i< n; i++)
        printf("%d ", a[i]);

}


#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
int main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  int n,i,j;
  float k;
  cin>>n;
  float v[n+1][n+1];
  for(i=1;i<=n;i++){
      for(j=1;j<=n;j++){
          cin>>k;
          v[i][j]=k;
      }
  }
    k=pow((v[1][2]/(v[2][3]/v[1][3])),0.5);
    cout<<k<<" ";
    for(j=2;j<=n;j++){i=1;
        cout<<v[i][j]/k<<" ";
    }
}


#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
const int N = 1010;
long long v[N][N];
int main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  int n,i,j;
  int k;
  cin>>n;

  for(i=1;i<=n;i++){
      for(j=1;j<=n;j++){
          cin>>k;
          v[i][j]=k;
      }
  }
    k=pow((v[1][2]/(v[2][3]/v[1][3])),0.5);
    cout<<k<<" ";
    for(j=2;j<=n;j++){i=1;
        cout<<v[i][j]/k<<" ";
    }
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <assert.h>

using namespace std;

#define ll long long

const int MAX_N = 1005;
ll mas[MAX_N][MAX_N];

int main()
{

	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			cin >> mas[i][j];
		}
	}

	ll ans2 = sqrt(mas[2][3] * mas[1][2] / mas[1][3]);

	for (int i = 1; i <= n; i++)
	{
		if (i == 2)
			cout << ans2 << " ";
		else
			cout << mas[2][i] / ans2 << " ";
	}

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int MAX_N = 1005;
ll mas[MAX_N][MAX_N];

int main()
{

	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			cin >> mas[i][j];
		}
	}

	ll ans2 = sqrt(mas[2][3] * mas[1][2] / mas[1][3]);

	for (int i = 1; i <= n; i++)
	{
		if (i == 2)
			cout << ans2 << " ";
		else
			cout << mas[2][i] / ans2 << " ";
	}

	return 0;
}


#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
const int N = 1010;
long long v[N][N];
int main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  int n,i,j;
  float k;
  cin>>n;

  for(i=1;i<=n;i++){
      for(j=1;j<=n;j++){
          cin>>k;
          v[i][j]=k;
      }
  }
    k=pow((v[1][2]/(v[2][3]/v[1][3])),0.5);
    cout<<k<<" ";
    for(j=2;j<=n;j++){i=1;
        cout<<v[i][j]/k<<" ";
    }
}


#include <bits/stdc++.h>
#define L long long
using namespace std;
int main()
{
int n,x;
cin>>n;
vector<int>a[n];
for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
    {
        cin>>x;
        if(x)
        a[i].push_back(x);
    }
vector<int>ans;
for(int i=0;i<n;i++)
{
    int y=a[i][0];
    for(int j=1;j<a[i].size();j++)
    {
        y=__gcd(a[i][j],y);
    }
    ans.push_back(y);
}
ans[0]=a[0][0]/ans[1];
for(int  i=0;i<n;i++)cout<<ans[i]<<' ';
return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long  a[1005][1005];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n;i++)
	for (int j = 0; j < n; j++)
		cin >> a[i][j];

	int x1 = sqrt(a[0][1]);
	int x2 = x1+1;
	vector<int>ans;
	ans.push_back(x1);
	int flag = 1;
	for (int i = 1; i < n; i++)
	{
		if (a[0][i] % x1 == 0)ans.push_back(a[0][i] / x1);
		else { flag = 0; break; }
	}
	if (flag)
	{
		for (int i = 0; i < n; i++){ cout << ans[i] << ' '; }
		return 0;
	}
	ans.clear();
	ans.push_back(x2);
	for (int i = 1; i < n; i++)
	{
		if (a[0][i] % x2 == 0)ans.push_back(a[0][i] / x2);
	}
	for (int i = 0; i < n; i++)cout << ans[i] << ' ';
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long  a[1005][1005];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n;i++)
	for (int j = 0; j < n; j++)
		cin >> a[i][j];

	int x = sqrt(a[0][1])+1;
	vector<int>ans;
	while (x)
	{
		int y = 0, z = x;
		ans.push_back(x);
		for (int i = 1; i < n; i++,y++)
		{
			if (a[y][i] % z == 0){ ans.push_back(a[y][i] / z); z = a[y][i] / z; }
			else { break; }
		}
		if (ans.size() == n){ for (int i = 0; i < n; i++)cout << ans[i] << ' '; return 0; }
		ans.clear();
		x--;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long  a[1005][1005];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n;i++)
	for (int j = 0; j < n; j++)
		cin >> a[i][j];

	int x = sqrt(a[0][1])+1;
	vector<int>ans;
	while (x)
	{
		ans.push_back(x);
		for (int i = 1; i < n; i++)
		{
			if (a[0][i] % x == 0){ ans.push_back(a[0][i] / x); }
			else { break; }
		}
		if (ans.size() == n){ for (int i = 0; i < n; i++)cout << ans[i] << ' '; return 0; }
		ans.clear();
		x--;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long  a[1005][1005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
        scanf("%lld",&a[i][j]);
    int a1=sqrt(a[0][1]*a[0][2] / a[1][2]);
    printf("%d ",a1);
    for(int i=1;i<n;i++)printf("%d ",a[0][i]/a1);
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long  a[1005][1005];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
        cin>>a[i][j];
    int a1=sqrt(a[0][1]*a[0][2] / a[1][2]);
    cout<<a1<<' ';
    for(int i=1;i<n;i++)cout<<a[0][i]/a1<<' ';
    cout<<'\n';
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long  a[1005][1005];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n;i++)
	for (int j = 0; j < n; j++)
		cin >> a[i][j];

	int x = sqrt(a[0][1])+1;
	vector<int>ans;
	while (x)
	{
		ans.push_back(x);
		for (int i = 1; i < n; i++)
		{
			if (a[0][i] % x == 0){ ans.push_back(a[0][i] / x); }
			else { break; }
		}
		if (ans.size() == n){ for (int i = 0; i < n; i++)cout << ans[i] << ' '; return 0; }
		ans.clear();
		x--;
	}
	x=a[0][1];
		ans.push_back(x);
		for (int i = 1; i < n; i++)
		{
			if (a[0][i] % x == 0){ ans.push_back(a[0][i] / x); }
			else { break; }
		}
		if (ans.size() == n){ for (int i = 0; i < n; i++)cout << ans[i] << ' '; return 0; }
		ans.clear();
		x=a[0][1]/2;
			ans.push_back(x);
		for (int i = 1; i < n; i++)
		{
			if (a[0][i] % x == 0){ ans.push_back(a[0][i] / x); }
			else { break; }
		}
		if (ans.size() == n){ for (int i = 0; i < n; i++)cout << ans[i] << ' '; return 0; }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin >> n;
	ll a[n][n];

	loop(i, 0, n)
	{
		loop(j, 0, n)
		{
			cin >> a[i][j];
		}
	}
	ll z = (a[0][1] * a[2][0]) / a[1][2];

	z = sqrt(z);
	cout << z << " ";
	for (ll i = 1; i < n; i++) cout << a[0][i] / z << " ";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin>>n;
	ll a[n][n];

	loop(i,0,n)
	loop(j,0,n)
	cin>>a[i][j];

	ld z=((a[0][1]*a[2][0])/a[1][2]);
	z=sqrt(z);

	cout<<z<<" ";
	for(ll i=1;i<n;i++)
	{
		cout<<a[i][0]/z<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin >> n;
	ll a[n][n];

	for (ll i = 0; i < n; i++)
		for (ll j = 0; j < n; j++) cin >> a[i][j];
			ll z = (a[0][1] * a[2][0]) / a[1][2];

		z = sqrt(z);
		cout << z << " ";
		for (ll i = 1; i < n; i++) cout << a[0][i] / z << " ";
	}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin>>n;
	ll a[n][n];

	loop(i,0,n)
	loop(j,0,n)
	cin>>a[i][j];

	ld z=((a[0][1]*a[2][0])/a[1][2]);
	z=sqrt(z);

	cout<<z<<" ";
	for(ll i=1;i<n;i++)
	{
		cout<<a[0][i]/z<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

ll a[1005][1005];
int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin>>n;
	loop(i,1,n+1)
	loop(j,1,n+1)
	cin>>a[i][j];

	ld z=sqrt((a[1][2]*a[1][3])/a[2][3]);

	cout<<z<<" ";
	for(ll i=2;i<=n;i++)
	{
		cout<<a[i][1]/z<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

ll a[1005][1005];
int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin>>n;
	loop(i,0,n)
	loop(j,0,n)
	cin>>a[i][j];

	ld z=((a[0][1]*a[2][0])/a[1][2]);
	z=sqrt(z);

	cout<<z<<" ";
	for(ll i=1;i<n;i++)
	{
		cout<<a[i][0]/z<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

ll a[1005][1005];
int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin>>n;
	loop(i,0,n)
	loop(j,0,n)
	cin>>a[i][j];

	ld z=sqrt((a[0][1]*a[0][2])/a[1][2]);

	cout<<z<<" ";
	for(ll i=1;i<n;i++)
	{
		cout<<a[i][0]/z<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
#define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(long ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}

ll a[1005][1005];
int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin>>n;
	loop(i,0,n)
	loop(j,0,n)
	cin>>a[i][j];

	ld z=sqrt((a[0][1]*a[2][0])/a[1][2]);

	cout<<z<<" ";
	for(ll i=1;i<n;i++)
	{
		cout<<a[i][0]/z<<" ";
	}
}


#include<bits/stdc++.h>
#define lli long long int
#define ulli unsigned long long int
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

int main(){

   fast;

   lli n;
   cin>>n;

   lli arr[n][n];
   lli ans[n];

   lli i, j;

   for(i=0; i<n; i++)
      for(j=0; j<n; j++)
         cin>>arr[i][j];

   for(i=0; i<n-2; i++){
      ans[i] = arr[i][i+1]*arr[i][i+2]/arr[i+1][i+2];
      ans[i] = sqrt(ans[i]);
   }

   ans[n-2] = arr[n-2][0]/ans[0];
   ans[n-1] = arr[n-1][0]/ans[0];

   for(i=0; i<n-2; i++)
      cout<<ans[i]<<" ";

   cout<<ans[n-2]<<" "<<ans[n-1];

   return 0;
}


#include<bits/stdc++.h>
#define lli long long int
#define ulli unsigned long long int
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

int main(){

   fast;

   lli n;
   cin>>n;

   lli arr[n][n];
   lli ans[n];

   lli i, j;

   for(i=0; i<n; i++)
      for(j=0; j<n; j++)
         cin>>arr[i][j];

   for(i=0; i<n-2; i++){
      ans[i] = arr[i][i+1]*arr[i][i+2]/arr[i+1][i+2];
      ans[i] = sqrt(ans[i]);
   }

   ans[n-2] = arr[n-2][0]/ans[0];
   ans[n-1] = arr[n-2][0]/ans[0];

   cout<<ans[n-2]<<" "<<ans[n-1];

   for(i=0; i<n; i++)
      cout<<" "<<ans[i];

   return 0;
}


#include<bits/stdc++.h>
#define lli long long int
#define ulli unsigned long long int
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

int main(){

   fast;

   lli n;
   cin>>n;

   lli arr[n][n];
   lli ans[n];

   lli i, j;

   for(i=0; i<n; i++)
      for(j=0; j<n; j++)
         cin>>arr[i][j];

   for(i=0; i<n-2; i++){
      ans[i] = arr[i][i+1]*arr[i][i+2]/arr[i+1][i+2];
      ans[i] = sqrt(ans[i]);
   }

   ans[n-2] = arr[n-2][0]/ans[0];
   ans[n-1] = arr[n-1][0]/ans[0];

   cout<<ans[n-2]<<" "<<ans[n-1];

   for(i=0; i<n; i++)
      cout<<" "<<ans[i];

   return 0;
}


#include<bits/stdc++.h>
#define lli long long int
#define ulli unsigned long long int
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

int main(){

   fast;

   lli n;
   cin>>n;

   lli arr[n][n];
   lli ans[n];

   lli i, j;

   for(i=0; i<n; i++)
      for(j=0; j<n; j++)
         cin>>arr[i][j];

   for(i=0; i<n-2; i++){
      ans[i] = arr[i][i+1]*arr[i][i+2]/arr[i+1][i+2];
      ans[i] = sqrt(ans[i]);
   }

   ans[n-2] = arr[n-2][0]/ans[0];
   ans[n-1] = arr[n-2][0]/ans[0];

   for(i=0; i<n; i++)
      cout<<ans[i]<<" ";

   return 0;
}


#include<bits/stdc++.h>
#define lli long long int
#define ulli unsigned long long int
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

int main(){

   fast;

   lli n;
   cin>>n;

   lli arr[n][n];
   lli ans[n];

   lli i, j;

   for(i=0; i<n; i++)
      for(j=0; j<n; j++)
         cin>>arr[i][j];

   for(i=0; i<n-2; i++){
      ans[i] = arr[i][i+1]*arr[i][i+2]/arr[i+1][i+2];
      ans[i] = sqrt(ans[i]);
   }

   ans[n-2] = arr[n-2][0]/ans[0];
   ans[n-1] = arr[n-1][0]/ans[0];

   cout<<ans[n-2]<<" "<<ans[n-1];

   for(i=0; i<n-2; i++)
      cout<<" "<<ans[i];

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

    for (int k = 1; k < n && k < 10; k++){
    	//cout << k << ":" << brojevi[k] << endl;
        for (int j = 0; j < k; j++){
        	//cout << j << " -- " << m[k][j] << endl;
            if (m[k][j] != brojevi[j] * brojevi[k]) return false;
        }
        for (int j = k + 1; j < n; j++){
        	//cout << j << " -- " << m[k][j] << endl;
            if (m[k][j] != brojevi[j] * brojevi[k]) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
            // cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;
        //cout << "0 -> " << *it << endl;

		bool ok = true;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
            	brojevi[j] = m[0][j] / brojevi[0];
            	//cout << j << " -> " << brojevi[j] << endl;
            }
            else{
                ok = false;
                break;
            }
        }

		if (!ok) continue;

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

    for (int j = 2; j < n; j++){
        if (m[1][j] % brojevi[1] != 0) return false;
    }
    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
            //cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
                brojevi[j] = m[0][j] / brojevi[0];
            }
            else{
                continue;
            }
        }

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

    for (int k = 1; k < n && k < 50; k++){
        for (int j = 0; j < k; j++){
            if (m[k][j] % brojevi[k] != 0) return false;
        }
        for (int j = k + 1; j < n; j++){
            if (m[k][j] % brojevi[k] != 0) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
          //  cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
                brojevi[j] = m[0][j] / brojevi[0];
            }
            else{
                continue;
            }
        }

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

    for (int k = 1; k < n && k < 100; k++){
        for (int j = k + 1; j < n; j++){
            if (m[k][j] % brojevi[k] != 0) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
            //cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
                brojevi[j] = m[0][j] / brojevi[0];
            }
            else{
                continue;
            }
        }

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

	ll x;

    for (int k = 1; k < n && k < 10; k++){
    	//cout << k << ":" << brojevi[k] << endl;
        for (int j = 0; j < k; j++){
        	//cout << j << " -- " << m[k][j] << endl;
        	x = brojevi[j] * brojevi[k];
            if (m[k][j] != x) return false;
        }
        for (int j = k + 1; j < n; j++){
        	//cout << j << " -- " << m[k][j] << endl;
        	x = brojevi[j] * brojevi[k];
            if (m[k][j] != x) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
            // cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;
        //cout << "0 -> " << *it << endl;

		bool ok = true;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
            	brojevi[j] = m[0][j] / brojevi[0];
            	//cout << j << " -> " << brojevi[j] << endl;
            }
            else{
                ok = false;
                break;
            }
        }

		if (!ok) continue;

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

    for (int k = 1; k < n && k < 10; k++){
        for (int j = 0; j < k; j++){
            if (m[k][j] % brojevi[k] != 0) return false;
        }
        for (int j = k + 1; j < n; j++){
            if (m[k][j] % brojevi[k] != 0) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
          //  cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
                brojevi[j] = m[0][j] / brojevi[0];
            }
            else{
                continue;
            }
        }

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

    for (int k = 1; k < n && k < 10; k++){
        for (int j = k + 1; j < n; j++){
            if (m[k][j] % brojevi[k] != 0) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
            //cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
                brojevi[j] = m[0][j] / brojevi[0];
            }
            else{
                continue;
            }
        }

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

	ll x;

    for (int k = 1; k < n && k < 2; k++){
    	//cout << k << ":" << brojevi[k] << endl;
        for (int j = 0; j < k; j++){
        	//cout << j << " -- " << m[k][j] << endl;
        	x = (ll) brojevi[j] * (ll) brojevi[k];
            if (m[k][j] != x) return false;
        }
        for (int j = k + 1; j < n; j++){
        	//cout << j << " -- " << m[k][j] << endl;
        	x = (ll) brojevi[j] * (ll) brojevi[k];
            if (m[k][j] != x) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
            // cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;
        //cout << "0 -> " << *it << endl;

		bool ok = true;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
            	brojevi[j] = m[0][j] / brojevi[0];
            	//cout << j << " -> " << brojevi[j] << endl;
            }
            else{
                ok = false;
                break;
            }
        }

		if (!ok) continue;

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair

const int MOD = 1e9 + 7;

const int N = 1e3 + 5;

int m[N][N];

int brojevi[N];
int n;

bool poklapa(){

	ll x;

    for (int k = 1; k < n && k < 10; k++){
    	//cout << k << ":" << brojevi[k] << endl;
        for (int j = 0; j < k; j++){
        	//cout << j << " -- " << m[k][j] << endl;
        	x = (ll) brojevi[j] * (ll) brojevi[k];
            if (m[k][j] != x) return false;
        }
        for (int j = k + 1; j < n; j++){
        	//cout << j << " -- " << m[k][j] << endl;
        	x = (ll) brojevi[j] * (ll) brojevi[k];
            if (m[k][j] != x) return false;
        }
    }

    return true;
}

int main(){

    cin >> n;

    for (int i = 0; i < n; i++)
        for (int j = 0 ; j < n; j++)
            cin >> m[i][j];

    set<int> delioci;
    set<int>::iterator it;

    for (int i = 1; i <= trunc(sqrt(m[0][1])); i++){
        if (m[0][1] % i == 0){
            // cout << i << " - " << m[0][1] / i << endl;
            delioci.insert(i);
            delioci.insert(m[0][1] / i);
        }
    }

   for (it = delioci.begin(); it != delioci.end(); ++it){

        brojevi[0] = *it;
        //cout << "0 -> " << *it << endl;

		bool ok = true;

        for (int j = 1; j < n ; j++){
            if (m[0][j] % brojevi[0] == 0){
            	brojevi[j] = m[0][j] / brojevi[0];
            	//cout << j << " -> " << brojevi[j] << endl;
            }
            else{
                ok = false;
                break;
            }
        }

		if (!ok) continue;

        if (poklapa()) break;
    }

    for (int i = 0; i < n; i++){
        cout << brojevi[i];
        if (i != n-1) cout << " ";
    }

    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi 3.14159265
#define oo 1000000007

using namespace std;
#define prime 1000000007

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";
using namespace std;

ll n, k;
ll mat[1010][1010], ans[1010];

int main(){
	scanf("%lld", &n);
	for (int i = 0; i < n; ++i){
		for (int j = 0; j < n; ++j){
			scanf("%lld", &mat[i][j]);
		}
	}
	ans[0] = sqrt(mat[0][1]*mat[0][2]/mat[1][2]);
	for (int i = 1; i < n; ++i){
		ans[i] = mat[0][i]/ans[0];
	}
	for (int i = 0; i < n; ++i){
		printf("%lld ", ans[i]);
	}
	printf("\n");

	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi 3.14159265
#define oo 1000000007

using namespace std;
#define prime 1000000007

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";
using namespace std;

ll n, k;
ll mat[1010][1010], ans[1010];

int main(){
	scanf("%lld", &n);

	for (int i = 0; i < n; ++i){
		for (int j = 0; j < n; ++j){
			scanf("%lld", &mat[i][j]);
		}
	}

	for (int i = 0; i < n; ++i){
		ll g = 1;
		for (int j = 0; j < n; ++j){
			if(j==i) continue;
			if(j == 0 || (j == 1 && i==0)) g = mat[i][j];
			else g = __gcd(g, mat[i][j]);

		}
		ans[i]=g;
	}

	for (int i = 0; i < n; ++i){
		ll aux = oo;
		for (int j = 0; j < n; ++j){
			if(i == j) continue;
			aux = min(ans[i]*ans[j]/mat[i][j], aux);
		}
		ans[i]/=aux;
	}

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

	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi 3.14159265
#define oo 1000000007

using namespace std;
#define prime 1000000007

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";
using namespace std;

ll n, k;
ll mat[1010][1010], ans[1010];

int main(){
	scanf("%lld", &n);
	int b;
	bool ok = true;
	for (int i = 0; i < n; ++i){
		for (int j = 0; j < n; ++j){
			scanf("%lld", &mat[i][j]);
			if(i == 0 && j == 1) b = mat[i][j];
			else if(mat[i][j] && mat[i][j] != b) ok = false;
		}
	}
	if(ok){
		for (int i = 0; i < n; ++i){
			printf("%d ", (int)sqrt(mat[0][1]));
		}
		printf("\n");
		return 0;
	}
	for (int i = 0; i < n; ++i){
		ll g = 1;
		for (int j = 0; j < n; ++j){
			if(j==i) continue;
			if(j == 0 || (j == 1 && i==0)) g = mat[i][j];
			else g = __gcd(g, mat[i][j]);
		}
		ans[i]=g;
	}
	for (int i = 0; i < n; ++i){
		ll aux = oo;
		for (int j = 0; j < n; ++j){
			if(i == j) continue;
			aux = min(ans[i]*ans[j]/mat[i][j], aux);
		}
		ans[i]/=aux;
	}
	for (int i = 0; i < n; ++i){
		printf("%lld ", ans[i]);
	}
	printf("\n");

	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi 3.14159265
#define oo 1000000007

using namespace std;
#define prime 1000000007

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";
using namespace std;

ll n, k;
ll mat[1010][1010], ans[1010];

int main(){
	scanf("%lld", &n);
	for (int i = 0; i < n; ++i){
		for (int j = 0; j < n; ++j){
			scanf("%lld", &mat[i][j]);
		}
	}
	for (int i = 0; i < n; ++i){
		ll g = 1;
		for (int j = 0; j < n; ++j){
			if(j==i) continue;
			if(j == 0 || (j == 1 && i==0)) g = mat[i][j];
			else g = __gcd(g, mat[i][j]);
		}
		ans[i]=g;
	}
	for (int i = 0; i < n; ++i){
		ll aux = -1;
		for (int j = 0; j < n; ++j){
			if(i == j) continue;
			aux = max(ans[i]*ans[j]/mat[i][j], aux);
		}
		ans[i]/=aux;
	}
	for (int i = 0; i < n; ++i){
		printf("%lld ", ans[i]);
	}
	printf("\n");

	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi 3.14159265
#define oo 1000000007

using namespace std;
#define prime 1000000007

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";
using namespace std;

ll n, k;
ll mat[1010][1010], ans[1010];

int main(){
	scanf("%lld", &n);

	for (int i = 0; i < n; ++i){
		for (int j = 0; j < n; ++j){
			scanf("%lld", &mat[i][j]);
		}
	}

	for (int i = 0; i < n; ++i){
		ll g = 1;
		for (int j = 0; j < n; ++j){
			if(j==i) continue;
			if(j == 0 || (j == 1 && i==0)) g = mat[i][j];
			else g = __gcd(g, mat[i][j]);

		}
		ans[i]=g;
	}

	for (int i = 0; i < n; ++i){
		for (int j = 0; j < n; ++j){
			if(i == j) continue;
			ll aux = ans[i]*ans[j]/mat[i][j];
			ans[i]/=aux;
		}
	}

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

	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi 3.14159265
#define oo 1000000007

using namespace std;
#define prime 1000000007

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";
using namespace std;

ll n, k;
ll mat[1010][1010], ans[1010];

int main(){
	scanf("%lld", &n);

	for (int i = 0; i < n; ++i){
		for (int j = 0; j < n; ++j){
			scanf("%lld", &mat[i][j]);
		}
	}

	for (int i = 0; i < n; ++i){
		ll g = 1;
		for (int j = 0; j < n; ++j){
			if(!i) {
				if(!j) continue;
				if(j == 1) g = mat[i][j];
				else g = __gcd(g, mat[i][j]);
			}else{
				ans[i] = mat[i][j]/ans[j];
				break;
			}
		}
		if(!i) {
			ans[i] = g;
			mat[i][i] = g*g;
		}
	}

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

	return 0;
}


#include <bits/stdc++.h>
#define x first
#define y second

using namespace std;

typedef long long INT;
typedef pair<int,int> pii;

const int NN=1010;
const int inf=0x3f3f3f3f;

INT a[NN][NN],b[NN];
INT sum[NN],SUM=0;

main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif
	int n;	cin>>n;

	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			scanf("%d",&a[i][j]);
		}
	}

	b[1]=a[2][1]*a[1][n]/a[2][n];
	b[1]=sqrt(b[1]);
	for(int i=2;i<=n;i++){
		b[i]=a[1][i]/b[1];
	}

	for(int i=1;i<=n;i++)cout<<b[i]<<" ";

	return 0;
}


#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long INT;
typedef pair<int,int>pii;
INT m[1111][1111],a[1111];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			scanf("%lld",&m[i][j]);
		}
	}INT q;
	for(int i=0;i<n-2;i++){
		int t=i;
		q=m[t][t+1]*m[t][t+2];
		q/=m[t+1][t+2];
		a[i]=sqrt(q);
	}
	a[n-2]=m[n-2][0]/a[0];
	a[n-1]=m[n-1][0]/a[0];
	for(int i=0;i<n;i++) printf("%lld ",a[i]);
}


#include <bits/stdc++.h>

using namespace std;

#define NN 1010
int M[NN][NN];
int a[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++) scanf("%d",&M[i][j]);
	}
	a[1]=1LL*M[1][2]*M[1][3]/M[2][3];
	a[1]=sqrt(a[1]);
	for(int i=2;i<=n;i++) a[i]=M[1][i]/a[1];
	for(int i=1;i<=n;i++) printf("%d ",a[i]);
    return 0;
}


#include<bits/stdc++.h>
#define pb push_back
#define inf 0x3f3f3f3f
#define x first
#define y second

using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
typedef vector<int> VI;

#define NN 1010

int a[NN][NN];
int ans[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int n; scanf("%d", &n);
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=n; j++) {
			scanf("%d", a[i]+j);
		}
	}

	int x=a[1][2], y=a[1][3], g=__gcd(x, y);
	x/=g, y/=g;

	int k=sqrt(a[2][3]/x/y);
	ans[2]=x*k;
	for(int i=1; i<=n; i++) if(i!=2) {
		ans[i]=a[i][2]/ans[2];
	}
	for(int i=1; i<=n; i++) printf("%d ", ans[i]);
}


#include <bits/stdc++.h>
#define pb push_back
#define x first
#define y second
using namespace std;
typedef double DO;
typedef long long INT;
typedef pair<int,int> pii;
typedef pair<pii,int> pi3;
template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}
int a[1010][1010];
int ans[1010];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) scanf("%d",a[i]+j);
	int mx=a[1][2];
	for(int i=3;i<=n;i++) mx=__gcd(mx,a[1][i]);
	ans[1]=mx;
	for(int i=2;i<=n;i++) ans[i]=a[1][i]/mx;
	int t=a[2][3]/ans[2]/ans[3];
	t=sqrt(t);
	for(int i=2;i<=n;i++) ans[i]*=t;
	ans[1]/=t;
	for(int i=1;i<=n;i++){
		cout<<ans[i];
		if(i<n) cout<<' ';
	}
	return 0;
}


#include<bits/stdc++.h>

#define inf 0x3f3f3f3f
#define pb push_back
#define NN 1010

using namespace std;
typedef long long INT;
typedef pair<int,int>pii;

int power(int a,int b,int m,int ans=1){
	for(;b;b>>=1,a=1LL*a*a%m )if(b&1)ans=1LL*ans*a%m;
	return ans;
}

int m[NN][NN];
int a[NN];
vector<int>p;

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			scanf("%d",&m[i][j]);
		}
	}
	int d=m[1][2];
	for(int i=3;i<=n;i++)d=__gcd(d,m[1][i]);
	for(int i=1;i*i<=d;i++){
		if(i*i==d)p.pb(i);
		else if(d%i==0){
			p.pb(i);
			p.pb(d/i);
		}
	}
	for(int v:p){
		a[1]=v;
		for(int i=2;i<=n;i++)a[i]=m[1][i]/v;
		int flag=0;
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++){
				if(i==j)continue;
				if(m[i][j]!=1ll*a[i]*a[j]){
					flag=1;
					break;
				}
			}
		if(flag==0){
			for(int i=1;i<=n;i++)printf("%d ",a[i]);
			cout<<endl;
			return 0;
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long INT;

#define NN 1010
int M[NN][NN];
INT a[NN];
INT sqrt3(INT x) {
	INT res=sqrt(x)-1e-7;
	while (res*res<=x) res++;
	return res-1;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++) scanf("%d",&M[i][j]);
	}
	a[1]=1LL*M[1][2]*M[1][3]/M[2][3];
	a[1]=sqrt(a[1]);
	for(int i=2;i<=n;i++) a[i]=M[1][i]/a[1];
	for(int i=1;i<=n;i++) printf("%I64d ",a[i]);
    return 0;
}


#include <bits/stdc++.h>
#define NN 1010
using namespace std;
typedef long long INT;
int m[NN][NN];
INT a[NN];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	scanf("%d", &n);
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			scanf("%d", &m[i][j]);
		}
	}
	for(int i = 1; i <= n; i++){
		if(i == 1) a[1] = (INT)m[2][1] * m[1][3] / m[2][3];
		else if(i == 2) a[2] = (INT)m[1][2] * m[2][3] / m[1][3];
		else a[i] = (INT)m[i - 1][i] * m[i][1] / m[i - 1][1];
		a[i] = (INT)sqrt(1.0 * a[i]);
	}
	for(int i = 1; i <= n; i++) printf("%d ", a[i]);
	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
typedef vector<int> VI;
int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

const int NN = 1011;
int a[NN][NN];
int ans[NN];

map<int, int> mp;

inline void get(int u) {
	for(int i=2; i*i<=u; i++) if(u%i==0) {
		int c=0;
		while(u%i==0) u/=i, c++;
		mp[i]+=c;
	}
	if(u>1) mp[u]+=1;

}
int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n;
	cin >> n;
	for(int i=0; i<n; i++) {
		for(int j=0; j<n; j++) {
			scanf("%d", a[i]+j);
		}
	}
	get(a[0][1]);
	get(a[0][2]);
	get(a[1][2]);
	INT m=1;
	for(auto p : mp) {
		int u = p.x, c = p.y;
		c /= 2;
		while(c--) m *= u;
	}
	ans[0] = m / a[1][2];
	for(int i=1; i<n; i++) ans[i] = a[0][i] / ans[0];
	for(int i=0; i<n; i++) cout << ans[i] << endl;
	return 0;
}


#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long INT;
typedef pair<int,int>pii;
INT m[1111][1111],a[1111];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			scanf("%lld",&m[i][j]);
		}
	}INT q;
	for(int i=0;i<n-2;i++){
		int t=0;
		q=m[t][t+1]*m[t][t+2];
		q/=m[i+1][i+2];
		a[i]=sqrt(q);
	}
	a[n-2]=m[n-2][0]/a[0];
	a[n-1]=m[n-1][0]/a[0];
	for(int i=0;i<n;i++) printf("%lld ",a[i]);
}


#include<bits/stdc++.h>

using namespace std;

using INT = long long;

#define NN 1111

int mat[NN][NN];
int a[NN];
int n;

int ok(int u) {
	a[1] = u;
	for(int i=2; i<=n; i++) a[i] = mat[1][i] / u;
	for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) if(i != j) {
		if(mat[i][j] != (INT) a[i] * a[j]) return 0;
	}
	for(int i=1; i<=n; i++) printf("%d ", a[i]);
	exit(0);
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	cin >> n;

	for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) {
		scanf("%d", &mat[i][j]);
	}

	int d = mat[1][2];

	for(int i=2; i<=n; i++) {
		d = __gcd(d, mat[1][i]);
	}

	for(int i=1; i*i<=d; i++) if(d % i == 0) {
		ok(i);
		ok(d/i);
	}

	return 0;
}


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define fr(i,a) for(int  i=0;i<a;i++)
#define forn(i,a,n) for(int i = a; i < n ;i++)
#define Sort(a) sort(a.begin(),a.end())
#define Rev(k)  reverse(k.begin(),k.end())
#define Sz(x) x.size()
#define Show(v) for(int i =0 ; i < v.size();i++) cout<<v[i] //only for string and vector
#define Mod 1000000007
#define Fi first
#define Sc second
#define pb push_back
//const int MAXN = 200100;
typedef long  ll;

int main(){
	int n ;
	cin>>n;
	ll **a = new ll*[n] ;
	fr(i,n){
		a[i] = new ll[n];
		fr(j,n){
			cin>>a[i][j];
		}
	}

	vector<ll> v;
	//for 1
	ll k = sqrt((a[0][1]*a[0][2])/a[1][2] ) ;
	v.pb(k) ;
	// 2
	k = sqrt((a[1][0]*a[1][2])/a[0][2]) ;

	v.pb(k) ;

	for(ll i = 2 ; i < n ; i++){
	k = sqrt((a[i][0]*a[i][1])/a[0][1]);
	v.pb(k) ;
	}

	Show(v)<<" " ;
	cout<<endl;
}


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define fr(i,a) for(int  i=0;i<a;i++)
#define forn(i,a,n) for(int i = a; i < n ;i++)
#define Sort(a) sort(a.begin(),a.end())
#define Rev(k)  reverse(k.begin(),k.end())
#define Sz(x) x.size()
#define Show(v) for(int i =0 ; i < v.size();i++) cout<<v[i] //only for string and vector
#define Mod 1000000007
#define Fi first
#define Sc second
#define pb push_back
//const int MAXN = 200100;
typedef long long  ll;

int main(){
	int n ;
	cin>>n;
	ll **a = new ll*[n] ;
	fr(i,n){
		a[i] = new ll[n];
		fr(j,n){
			cin>>a[i][j];
		}
	}

	vector<ll> v;
	//for 1
	ll k = sqrt((a[0][1]*a[0][2])/a[1][2] ) ;
	v.pb(k) ;
	// 2
	k = sqrt((a[1][0]*a[1][2])/a[0][2]) ;

	v.pb(k) ;

	for(ll i = 2 ; i < n ; i++){
	k = sqrt((a[i][0]*a[i][1])/a[0][1]);
	v.pb(k) ;
	}

	Show(v)<<" " ;
	cout<<endl;
}


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define fr(i,a) for(int  i=0;i<a;i++)
#define forn(i,a,n) for(int i = a; i < n ;i++)
#define Sort(a) sort(a.begin(),a.end())
#define Rev(k)  reverse(k.begin(),k.end())
#define Sz(x) x.size()
#define Show(v) for(int i =0 ; i < v.size();i++) cout<<v[i] //only for string and vector
#define Mod 1000000007
#define Fi first
#define Sc second
#define pb push_back
//const int MAXN = 200100;
typedef long  ll;

int main(){
	int n ;
	cin>>n;
	ll **a = new ll*[n] ;
	fr(i,n){
		a[i] = new ll[n];
		fr(j,n){
			cin>>a[i][j];
		}
	}

	vector<ll> v;
	//for 1
	ll k = sqrt((a[0][1]*a[0][2])/a[1][2] ) ;
	v.pb(k) ;
	// 2
	k = sqrt((a[1][0]*a[1][2])/a[0][2]) ;

	v.pb(k) ;

	for(ll i = 2 ; i < n ; i++){
		sqrt((a[i][0]*a[i][1])/a[0][1]);
	v.pb(k) ;
	}

	Show(v)<<" " ;
	cout<<endl;
}


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define fr(i,a) for(int  i=0;i<a;i++)
#define forn(i,a,n) for(int i = a; i < n ;i++)
#define Sort(a) sort(a.begin(),a.end())
#define Rev(k)  reverse(k.begin(),k.end())
#define Sz(x) x.size()
#define Show(v) for(int i =0 ; i < v.size();i++) cout<<v[i] //only for string and vector
#define Mod 1000000007
#define Fi first
#define Sc second
#define pb push_back
//const int MAXN = 200100;
typedef long  ll;

int main(){
	int n ;
	cin>>n;
	ll **a = new ll*[n] ;
	fr(i,n){
		a[i] = new ll[n];
		fr(j,n){
			cin>>a[i][j];
		}
	}
	vector<ll> v;

	fr(i,n){
		ll k ;
		if(i==0)
			k = a[i][1];
		else
			k= a[i][0] ;

		fr(j,n){
			if(i==j){
				continue;
			}
			k = __gcd(k,a[i][j] ) ;
		}
		v.pb(k) ;
	}

	Show(v)<<" ";
	cout<<endl;
}


#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define fr(i,a) for(int  i=0;i<a;i++)
#define forn(i,a,n) for(int i = a; i < n ;i++)
#define Sort(a) sort(a.begin(),a.end())
#define Rev(k)  reverse(k.begin(),k.end())
#define Sz(x) x.size()
#define Show(v) for(int i =0 ; i < v.size();i++) cout<<v[i] //only for string and vector
#define Mod 1000000007
#define Fi first
#define Sc second
#define pb push_back
//const int MAXN = 200100;
typedef long  ll;

int main(){
	int n ;
	cin>>n;
	ll **a = new ll*[n] ;
	fr(i,n){
		a[i] = new ll[n];
		fr(j,n){
			cin>>a[i][j];
		}
	}

	vector<ll> v;
	//for 1
	ll k = a[0][1]*a[0][2];
	k/=a[1][2] ;
	k = sqrt(k) ;
	v.pb(k) ;
	// 2
	k = a[1][0]*a[1][2];
	k/=a[0][2] ;
	k = sqrt(k) ;
	v.pb(k) ;

	for(ll i = 2 ; i < n ; i++){
		k = a[i][0] *a[i][1] ;
		k/=a[0][1] ;
	k = sqrt(k) ;
	v.pb(k) ;
	}

	Show(v)<<" " ;
	cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
unsigned int x,a[1000][1000],i,j,b[1000];
unsigned long long int t;
cin>>x;
for(i=0;i<x;i++)
{
	for(j=0;j<x;j++)
	{
		cin>>a[i][j];
	}
}
t=a[1][0]*a[2][0];
t=t/a[2][1];
t=sqrt(t);
b[0]=t;
for(i=1;i<x;i++)
{
b[i]=a[i][0]/b[0];
}
for(i=0;i<x;i++)
cout<<b[i]<<" ";
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int x,a[1000][1000],i,j,b[1000];
long long long long int t;
cin>>x;
for(i=0;i<x;i++)
{
	for(j=0;j<x;j++)
	{
		cin>>a[i][j];
	}
}
t=a[1][0]*a[2][0];
t=t/a[2][1];
t=sqrt(t);
b[0]=t;
for(i=1;i<x;i++)
{
b[i]=a[i][0]/b[0];
}
for(i=0;i<x;i++)
cout<<b[i]<<" ";
return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
long long digit[1005][1005];
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			cin >> digit[i][j];
		}
	}
	long long a[1005];
	a[2] = sqrt(digit[1][2] * digit[2][3] / digit[1][3]);
	a[1] = digit[1][2] / a[2];
	for (int i = 3; i <= n; i++)
	{
		a[i] = digit[2][i] / a[2];
	}
	for (int i = 1; i < n; i++)
	{
		cout << a[i] << " ";
	}
	cout << a[n] << endl;
	//system("pause");
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <string>
#include <set>
#include <stack>
#include <sstream>
#include <list>
#include <array>
#include <vector>
#include <queue>
#include <map>
#include <memory>
#include <iterator>
#include <climits>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef unsigned int UINT;
typedef unsigned long long ull;
typedef pair<int, int> pdi;
typedef pair<ll, int> pli;

int const maxn = 1e3 + 10;
inline int lc(int x)  {return x << 1;}
inline int rc(int x)  {return x << 1 | 1;}

int m[maxn][maxn];

int main(void) {
    FAST_IO;

    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            cin >> m[i][j];
        }
    }
    int x = 0;
    for (int i = 1; i <= n; i++) {
        x = __gcd(m[1][i], x);
    }
    int ans = x;
    for (int i = x - 1; i >= 2; i--) {
        if (x % i == 0) {
            int flag = 0;
            for (int j = 1; j <= n; j++) {
                if (m[1][j] % i != 0) {
                    flag = 1;
                    break;
                }
            }
            if (!flag) {
                ans = i;
                // break;
            }
        }
    }
    cout << ans;
    for (int i = 2; i <= n; i++) {
        cout << " " << m[1][i] / ans;
    }
    cout << endl;
    return 0;
}