Sasha grew up and went to first grade. To celebrate this event her mother bought her a multiplication table $M$ with $n$ rows and $n$ columns such that $M_{ij}=a_i \cdot a_j$ where $a_1, \dots, a_n$ is some sequence of positive integers.

Of course, the girl decided to take it to school with her. But while she was having lunch, hooligan Grisha erased numbers on the main diagonal and threw away the array $a_1, \dots, a_n$. Help Sasha restore the array!


-----Input-----

The first line contains a single integer $n$ ($3 \leqslant n \leqslant 10^3$), the size of the table. 

The next $n$ lines contain $n$ integers each. The $j$-th number of the $i$-th line contains the number $M_{ij}$ ($1 \leq M_{ij} \leq 10^9$). The table has zeroes on the main diagonal, that is, $M_{ii}=0$.


-----Output-----

In a single line print $n$ integers, the original array $a_1, \dots, a_n$ ($1 \leq a_i \leq 10^9$). It is guaranteed that an answer exists. If there are multiple answers, print any.


-----Examples-----
Input
5
0 4 6 2 4
4 0 6 2 4
6 6 0 3 6
2 2 3 0 2
4 4 6 2 0

Output
2 2 3 1 2 
Input
3
0 99990000 99970002
99990000 0 99980000
99970002 99980000 0

Output
9999 10000 9998

Difficulty: competition

Starter code:

Solutions:
n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]
x = A[0][1]
y = A[1][2]
z = A[0][2]
p = (x * y * z) ** 0.5
a1 = p // y
a2 = p // z
a3 = p // x
ans = [round(a1), round(a2), round(a3)]
for i in range(3, n):
    ans.append(round(A[0][i] // a1))
print(' '.join(list(map(str, ans))))

n=int(input())
grid=[]
for i in range(n):
    l1=list(map(int,input().split()))
    grid.append(l1)
first=grid[0][1]*grid[0][2]
first=first//grid[1][2]
first=int(first**0.5)
result=[first]
for i in range(1,n):
    result.append(grid[0][i]//first)
print(*result,sep=" ")

n = int(input())
table = [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    num = table[i][(i+1) % n]
    num2 = table[i][(i+2) % n]
    num3 =  table[(i+2) % n][(i+1) % n]
    print(int((num * num2 / num3)**0.5),end = " ")

n = int(input())
m = [list(map(int,input().split())) for i in range(n)]
def gcd(a,b):
	if a == 0:
		return b
	return gcd(b%a, a)
g = m[0][1]
for i in range(2, n):
	g = gcd(g, m[0][i])
b = [m[0][i]/g for i in range(1, n)] #a2, a3,.., an jest wielokrotnoscia b
import math
kw = math.sqrt(m[1][2] / (b[0]*b[1]))
c = [b[i] * kw for i in range(n-1)]
a0 = m[0][1]/c[0]
c = [a0] + c
for i in c:
	print(int(i), end = " ")


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
# print = stdout.write
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
n = int(input())
z = []
for i in range(n):
    z.append(listin())
first = (z[0][1]*z[0][2])//z[1][2]
first = int((first**0.5))
a = [first]
for i in range(1, n):
    a.append(z[0][i]//a[0])
print(*a)

from math import *

n = int(input())
l = []
for i in range(n):
    l.append(list(map(int,input().split())))
x = int(sqrt((l[0][2]/l[1][2])*l[0][1]))
print(x,end = " ")
for i in range(1,n):
    print(l[0][i]//x,end = " ")

from math import *
n=int(input())
v=[[int(g) for g in input().split()] for i in range(n)]
n1=int(sqrt(v[0][1]*v[0][2]/v[1][2]))
print(n1, end=' ')
for i in range(1,n):
    print(v[0][i]//n1, end=' ')


from math import sqrt
n = int(input())
m = {}
for i in range(n):
    line = input()
    mi = [int(x) for x in line.strip().split()]
    for j in range(n):
        if i not in m:
            m[i] = {}
        m[i][j] = mi[j]

res = []
for i in range(n):
    x = m[i][(i+1)%n]
    y = m[i][(i+2)%n]
    z = m[(i+1)%n][(i+2)%n]
    res.append(str(int(sqrt(int(x*y/z)))))

print(' '.join(res))

n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
a1 = round((a[0][1] * a[0][2] // a[1][2]) ** 0.5)
print(a1, end=" ")
for i in range(1, n):
    print(a[i][0] // a1, end=" ")


n = int(input())


m = list(map(int, input().split()))[1:]
a = list(map(int, input().split()))[2]


for i in range(n-2):
    input()
b = int((m[0]*m[1]/a)**0.5)
print(b, end=' ')
for el in m:
    print(el//b, end=' ')


n = int(input())
m = []
for i in range(n):
	s = list(map(int, input().split()))
	m.append(s)
a = []
from math import sqrt
s = m[0][1] * m[0][2] * m[1][2]
s = int(sqrt(s) + 0.0001)
a1 = s // m[1][2]
a2 = s // m[0][2]
a3 = s // m[0][1]
a = [a1, a2, a3]
for i in range(3, n):
	z = m[0][i] // a1
	a.append(z)
print(*a)

from math import sqrt
n = int(input())
matrix = []
for i in range(n):
    matrix.append(list(map(int, input().split())))

a0 = int(sqrt(matrix[0][1] * matrix[0][2] / matrix[1][2]))
print(a0, end=' ')
for i in range(1, n):
    print(int(matrix[0][i]/a0), end=' ')

print('')

from math import sqrt
n=int(input())
l=[]
for i in range(n):
    ll=list(map(int,input().split()))
    l.append(ll)
res=[]
for i in range(n-2):
    res.append(int(sqrt((l[i][-1]*l[i][-2])//l[-1][-2])))
res.append(int(sqrt((l[-2][0]*l[-2][-1])//l[0][-1])))
res.append(int(sqrt((l[-1][0]*l[-1][1])//l[0][1])))
print(*res)

n = int(input())

t = [list(map(int, input().split())) for i in range(n)]

b = int((t[0][1] * t[1][2] / t[0][2]) ** 0.5)
a = []
a.append(t[0][1] // b)
a.append(b)

for i in range(2, n):
    a.append(t[i][1] // b)

print(*a)


from math import sqrt

n = int(input())

A = []

for i in range(n):
	A.append(list(map(int, input().split())))

ans = [0 for i in range(n)]

for i in range(n):
	x = A[i][(i + 1) % n] * A[(i + 1) % n][(i + 2) % n]

	x = x // (A[i][(i + 2) % n])

	ans[(i + 1) % n] = int(sqrt(x))


print(*ans)


import math
from decimal import Decimal
import heapq
def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return n,b
 
 
def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return n,b,c
 
 
def dv():
	n, m = map(int, input().split())
	return n,m
 
 
def dva():
	n, m = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return n,m,b
 
 
def eratosthenes(n): 
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))
 
 
def lol(lst,k):
	k=k%len(lst)
	ret=[0]*len(lst)
	for i in range(len(lst)):
		if i+k<len(lst) and i+k>=0:
			ret[i]=lst[i+k]
		if i+k>=len(lst):
			ret[i]=lst[i+k-len(lst)]
		if i+k<0:
			ret[i]=lst[i+k+len(lst)]
	return(ret)
def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return n,b,m,c
 
 
def dvs():
	n = int(input())
	m = int(input())
	return n, m 
def Factor(n):
	Ans = []
	d = 2
	while d * d <= n:
		if n % d == 0:
			Ans.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		Ans.append(n)
	return Ans


n = int(input())
a = []
for i in range(n):
	a.append(list(map(int, input().split())))
for i in range(n):
	if i == 0:
		x = i + 1
		j = i + 2
		tc1 = a[i][x]
		tc2 = a[i][j]
		print(int((tc1 * tc2 // a[x][j]) ** 0.5), end = ' ')
	elif i == n - 1:
		x = i - 1
		j = i - 2
		tc1 = a[i][x]
		tc2 = a[i][j]
		print(int((tc1 * tc2 // a[x][j]) ** 0.5), end = ' ')
	else:
		x = 0
		j = n - 1
		tc1 = a[i][x]
		tc2 = a[i][j]
		print(int((tc1 * tc2 // a[x][j]) ** 0.5), end = ' ')


n = int(input(''))
a = []
import math
a.append(0)
for i in range(n):
    ip = list(map(int,input('').split(' ')))
    a.append(ip)
ans = [0]*(n+1)
ans[3] = math.sqrt((a[3][1]*a[3][0])//a[2][0])
ans[2] = a[3][1]//ans[3]
ans[1] = a[3][0]//ans[3]
for i in range(3,n+1,1):
    ans[i] = a[i][0]//ans[1]
for i in range(1,n+1,1):
    print(int(ans[i]), end=' ')
    

import math

n = int(input())
prod = [[int(tok) for tok in input().split()] for _ in range(n)]

prod3 = int(math.sqrt(prod[0][1] * prod[0][2] * prod[1][2]))
first = prod3 // prod[1][2]

print(first, end = " ")
for i in range(1, n):
    print(prod[0][i] // first, end = " ")
print()


from math import sqrt

n = int(input())
arr = [list(map(int, input().split())) for _ in range(n)]
kek = []
for i in range(n):
    lol = [0, 1] if i > 1 else [1, 2] if i == 0 else [0, 2]
    a, b = lol
    kek.append(int(sqrt(arr[i][a] * arr[i][b] // arr[a][b])))
print(' '.join(map(str, kek)))


import sys
from math import sqrt

first = True
table = []
at = 0
for line in sys.stdin:
    if first:
        n = int(line)
        first = False
        continue
    table.append([int(a) for a in line.split()])
    at +=1
    if at==n:
        break

at = 0
end = ' '
for i, line in enumerate(table):
    a_i = int(sqrt(line[i-1]*line[i-2]/table[i-1][i-2]))
    at += 1
    if at == n:
        end='\n'
    print(a_i, end=end)


import sys 
from collections import defaultdict
from itertools import combinations
input = lambda : sys.stdin.readline().rstrip()

n = int(input())
arr = [list(map(int, input().split())) for i in range(n)]
ans = [0] * n 

for i in range(n-2):
  ans[i] = int(((arr[i][i+1] * arr[i][i+2]) // arr[i+1][i+2]) ** 0.5)

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

print(*ans)



import math 

n = int(input())
a = []
for _ in range(n):
    tmp = list(map(int, input().split()))
    a.append(tmp)

x = n * [None]
for i in range(n):
    solved = False
    for j in range(n):        
        for k in range(n):
            if (i != j) and (j != k) and (k != i):
                xi = int(math.sqrt(a[i][j] * a[i][k] / a[k][j]))
                x[i] = xi
                solved = True
                break
        if solved:
            break
print(' '.join(list(map(str, x))))





def gns():
	return list(map(int,input().split()))
n=int(input())
ns=[]

def gcd(a,b):
	if a%b == 0:
		return b
	else :
		return gcd(b,a%b)

for i in range(n):
	ns.append(gns())

a1=ns[0][1]
a2=ns[0][2]
g=gcd(a1,a2)
a1=a1//g
a2=a2//g
a12=ns[1][2]
import math
x=int(math.sqrt(a12//a1//a2))
for y in range(x-1,x+2):
	if y*y*a1*a2==a12:
		break
a1=y*a1
ans=[None]*n
ans[1]=a1
for i in range(n):
	if i==1:
		continue
	ans[i]=ns[1][i]//a1
print(' '.join(map(str,ans)))



x = int(input())
mass = []
for i in range(x):
    l = list(map(int, input().split()))
    mass += [l]
res = [0 for i in range(x)]
res[0] = int(((mass[0][1] * mass[0][2]) // mass[1][2]) ** 0.5)
for i in range(1, x):
    res[i] = int(mass[0][i] // res[0])
print(*res)

import math
N = int(input())
M = []
for _ in range(N):
    M.append(list(map(int,input().split())))

M[0][0] = int(math.sqrt((M[0][1]*M[0][2])/M[1][2]))

for n in range(1, N):
    M[n][n] = int(M[n-1][n]/M[n-1][n-1])
ans = []
for n in range(N):
    ans.append(str(M[n][n]))
print(" ".join(ans))