import math N = int(input()) A = list(map(int, input().split())) A.sort() x, y = A[-2], A[-1] g = math.gcd(x, y) x, y = x//g, y//g print(x, y)