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)

/*
  AOJ 1069
  Title:Squid Multiplication
  @kankichi573
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int n,b[31375],ans[250];

long long gcd(long long a, long long b)
{
        int c;
        while (b > 0) {
                c = a % b;
                a = b;
                b = c;
        }
        return a;
}

int compare(const void *a, const void *b)
{
  return( *(int *)a - *(int *)b);
}


main()
{
  int n,i,j;
  long long x,even;
  
  while(scanf("%d",&n) && n)
    {
      even=0;
      for(i=0;i<n*(n+1)/2;i++)
	{
	  scanf("%lld",&x);
	  b[i]=x;
	  if((x % 2)==0)
	    {
	      if(even==0)
		even = x;
	      else
		even = gcd(x,even);
	    }
	}

      for(i=j=0;i<n*(n+1)/2;i++)
	if((b[i] % 2)==0)
	    ans[j++]=b[i]/even;

      qsort(ans,n,sizeof(int),compare);
      printf("%lld\n",even);
      for(i=0;i<n;i++)
	{
	  if(i)
	    printf(" ");
	  printf("%d",ans[i]);
	}
      printf("\n");
    }
  return(0);
}