Problem:
Problem H: Squid Multiplication

Squid Eiko loves mathematics.
Especially she loves to think about integer.
One day, Eiko found a math problem from a website.

"A sequence b ={ai + aj | i < j } is generated from a sequence a ={a0 , ... , an | ai is even if i is 0, otherwise ai is odd}. Given the sequence b , find the sequence a ."

This problem is easy for Eiko and she feels boring. So, she made a new problem by modifying this problem .

"A sequence b ={ai *aj | i < j } is generated from a sequence a ={ a0, ... , an | ai is even if i is 0, otherwise ai is odd}. Given the sequence b , find the sequence a ."

Your task is to solve the problem made by Eiko.

Input

Input consists of multiple datasets.

Each dataset is given by following formats.

n
b0 b1 ... bn*(n+1)/2-1

n is the number of odd integers in the sequence a. The range of n is 2 ≤ n ≤ 250.
bi is separated by a space.
Each bi is 1 ≤ bi ≤ 263-1.
The end of the input consists of a single 0.

Output

For each dataset, you should output two lines.
First line contains a0, an even number in the sequence a.
The second line contains n odd elements separated by a space. The odd elements are sorted by increasing order.
You can assume that the result is greater than or equal to 1 and less than or equal to 231-1.

Sample input

3
6 10 14 15 21 35
2
30 42 35
0

Sample output

2
3 5 7
6
5 7

Solution in C (judge verdict: Wrong Answer)

// Aizu Vol-10 1069: Squid Multiplication
// 2017.8.18 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

long long odd[32000], even[32000];
int ol, el;

long long gcd(long long a, long long b)
{
	long long r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

int cmp(long long *a, long long *b) {
	if (*a < *b) return -1;
	if (*a == *b) return 0;
	return 1;
}

int main()
{
	int n, k, i;
	long long g, g2, e1, e2, o1;

	while (scanf("%d", &n) && n) {
		k = n*(n + 1) / 2;
		for (ol = el = 0, i = 0; i < k; i++) {
			scanf("%lld", &g);
			if (g & 1) odd[ol++] = g;
			else       even[el++] = g;
		}
		qsort(odd, ol, sizeof(long long), cmp);
		qsort(even, el, sizeof(long long), cmp);
		e1 = even[0], e2 = even[1], o1 = odd[0];
		g = gcd(e1, e2);
		g2 = gcd(g, o1); g /= g2, o1 /= g2;
		g2 = gcd(g, o1); g /= g2, o1 /= g2;
		printf("%lld\n%lld", g, even[0]/g);
		for (i = 1; i < n; i++) printf(" %lld", even[i]/g);
		putchar('\n');
	}
	return 0;
}