#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef long long ll;

ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; }

int main(){
	for(int n;scanf("%d",&n),n;){
		static ll b[32000];
		int m=n*(n+1)/2;
		rep(i,m) scanf("%lld",b+i);

		int n_ev=0,n_od=0;
		static ll b_ev[250],b_od[32000];
		rep(i,m){
			if(b[i]%2==0) b_ev[n_ev++]=b[i];
			else          b_od[n_od++]=b[i];
		}

		sort(b_ev,b_ev+n_ev);
		sort(b_od,b_od+n_od);

		vector<ll> a0_cand;
		rep(j,n_ev) rep(i,j) {
			ll x=b_ev[i],y=b_ev[j],z=b_od[0],g;
			g=gcd(x,z); x/=g; z/=g;
			g=gcd(y,z); y/=g; z/=g;
			if(z==1){
				ll a0=(ll)(sqrt(x)*sqrt(y)+0.5);
				for(ll t=max(a0-7,2LL);t<=a0+7;t++){
					if(t%2==0 && t*t==x*y) a0_cand.push_back(t);
				}
			}
		}

		ll a0;
		static ll a_od[250];
		rep(i,a0_cand.size()){
			a0=a0_cand[i];

			rep(j,n) a_od[j]=b_ev[j]/a0;

			int n_od2=0;
			static ll b_od2[32000];
			rep(k,n_ev) rep(j,k) b_od2[n_od2++]=a_od[j]*a_od[k];
			sort(b_od2,b_od2+n_od2);

			bool ok=true;
			rep(j,n_od) if(b_od[j]!=b_od2[j]) { ok=false; break; }
			if(ok) break;
		}

		printf("%lld\n",a0);
		rep(i,n_ev) printf("%lld%c",a_od[i],i<n_ev-1?' ':'\n');
	}

	return 0;
}
### Prompt

Construct a Cpp code solution to the problem outlined:

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.

Example

Input

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


Output

2
3 5 7
6
5 7

### Response

```cpp
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef long long ll;

ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; }

int main(){
	for(int n;scanf("%d",&n),n;){
		static ll b[32000];
		int m=n*(n+1)/2;
		rep(i,m) scanf("%lld",b+i);

		int n_ev=0,n_od=0;
		static ll b_ev[250],b_od[32000];
		rep(i,m){
			if(b[i]%2==0) b_ev[n_ev++]=b[i];
			else          b_od[n_od++]=b[i];
		}

		sort(b_ev,b_ev+n_ev);
		sort(b_od,b_od+n_od);

		vector<ll> a0_cand;
		rep(j,n_ev) rep(i,j) {
			ll x=b_ev[i],y=b_ev[j],z=b_od[0],g;
			g=gcd(x,z); x/=g; z/=g;
			g=gcd(y,z); y/=g; z/=g;
			if(z==1){
				ll a0=(ll)(sqrt(x)*sqrt(y)+0.5);
				for(ll t=max(a0-7,2LL);t<=a0+7;t++){
					if(t%2==0 && t*t==x*y) a0_cand.push_back(t);
				}
			}
		}

		ll a0;
		static ll a_od[250];
		rep(i,a0_cand.size()){
			a0=a0_cand[i];

			rep(j,n) a_od[j]=b_ev[j]/a0;

			int n_od2=0;
			static ll b_od2[32000];
			rep(k,n_ev) rep(j,k) b_od2[n_od2++]=a_od[j]*a_od[k];
			sort(b_od2,b_od2+n_od2);

			bool ok=true;
			rep(j,n_od) if(b_od[j]!=b_od2[j]) { ok=false; break; }
			if(ok) break;
		}

		printf("%lld\n",a0);
		rep(i,n_ev) printf("%lld%c",a_od[i],i<n_ev-1?' ':'\n');
	}

	return 0;
}
```