#P1011. Hack it!

Hack it!

题目描述

Please notice that this problem only needs you to give your hack data, which means you think Little m's program can't pass your input data.

Little m got a problem yesterday, which is below:

Recently you have received two positive integer numbers xx and yy. You forgot them, but you remembered a shuffled list containing all divisors of xx (including 11 and xx) and all divisors of yy (including 11 and yy). If dd is a divisor of both numbers xx and yy at the same time, there are two occurrences of dd in the list.

For example, if x=4x=4 and y=6y=6 then the given list can be any permutation of the list [1,2,4,1,2,3,6]. Some of the possible lists are: [1,1,2,4,6,3,2],[4,6,1,1,2,3,2] or [1,6,3,2,4,1,2].

Your problem is to restore suitable positive integer numbers xx and yy that would yield the same list of divisors (possibly in different order).

It is guaranteed that the answer exists, i.e. the given list of divisors corresponds to some positive integers xx and yy.

Input

The first line contains one integer nn (2n128)(2≤n≤128) — the number of divisors of xx and yy.

The second line of the input contains nn integers d1,d2,,dn(1di104)d_1,d_2,…,d_n (1≤d_i≤10^4), where did_i is either divisor of xx or divisor of yy. If a number is divisor of both numbers xx and yy then there are two copies of this number in the list.

Output

Print two positive integer numbers xx and yy (x,y>1)(x,y>1) — such numbers that merged list of their divisors is the permutation of the given list of integers. It is guaranteed that the answer exists, and you can print any order of x and y.

Sample Input and Output

Sample Input Sample Output
10
10 2 8 1 2 4 1 20 4 5
20 8

And he has got a solution which is below:

#include <iostream> 
#include <algorithm> 
int a[1005]; 
int main() 
{ 
	int n; 
	scanf("%d",&n); 
	for(int i=1;i<=n;i++) scanf("%d",&a[i]); 
	std::sort(a+1,a+1+n); 
	if(a[n]==a[n-1]) printf("%d %d",a[n],a[n]); 
	else 
	{ 
		int x=a[n],y=0; 
		for(int j=n-1;j;j--) 
 if(x%a[j]!=0) 
		{ 
			y=a[j]; 
			break; 
		} 
		printf("%d %d",x,y); 
	} 
} 

And fortunately, he passed all the tests. But Mr.M found that there might be some problems in little m's code. He wants to point it out, but he is very busy to do that, so he asks you to hack his code.

To hack one's code is that you construct the input, then if the code gives wrong output, you hack the code successfully, otherwise, you fail to hack the code.

And you need to guarantee that your input is under the constraints of the original problem's input.

In this problem, if you hack the code successfully, you will get Accepted.

Otherwise, if your input is invalid or you fail to hack the code, you will both get WRONG ANSWER.

If there are multiple ways to hack the code, any one of them is accepted.

输入格式

输出格式

样例

10 
10 2 8 1 2 4 1 20 4 5
the code will output 20 8 then you fail to hack the code, you will get WRONG_ANSWER

提示

We have one example in the sample input, please notice that it is not right.

The sample output only shows your hack status, it doesnt mean you should print that, what you only need to do is just that print the hack data.