Page not loading? Try clicking here.
Placeholder

#1002

GCD, LCM 1s 64MB

Problems

Write a program that, given nnn integers, computes their greatest common divisor and their least common multiple.


Input

The first line contains N (2 ≤ N ≤ 10).
The next line contains N integers separated by spaces.

Each integer is between 2 and 10,000 inclusive. All inputs satisfy these constraints.


Output

Output the greatest common divisor and the least common multiple of the given integers, separated by a space.

The least common multiple will not exceed 2,000,000,000.


Example

3

2 8 10
2 40


Source

JUNGOL

You must sign in to write code.