from math import gcd from heapq import heappop, heappush class Fraction: def __init__(self, x, y): self.x = x self.y = y def __lt__(self, other): return self.x * other.y < other.x * self.y def __le__(self, other): return self.x * other.y <= other.x * self.y def __gt__(self, other): return self.x * other.y > other.x * self.y def __ge__(self, other): return self.x * other.y >= other.x * self.y def __eq__(self, other): return self.x * other.y == other.x * self.y def upd(i, j): if i < N: if i + 1 != j: if (i + 1, j) not in vis: heappush(hq, (Fraction(A[i + 1], A[j]), i + 1, j)) vis.add((i + 1, j)) elif i + 2 < N: if (i + 2, j) not in vis: heappush(hq, (Fraction(A[i + 1], A[j]), i + 2, j)) vis.add((i + 2, j)) if 0 < j: if j - 1 != i: if (i, j - 1) not in vis: heappush(hq, (Fraction(A[i], A[j - 1]), i, j - 1)) vis.add((i, j - 1)) elif i < j - 2: if (i, j - 2) not in vis: heappush(hq, (Fraction(A[i], A[j - 1]), i, j - 2)) vis.add((i, j - 2)) N = int(input()) A = list(map(int, input().split())) A.sort() vis = set() hq = [(Fraction(A[0], A[-1]), 0, N - 1)] vis.add((0, N - 1)) for _ in range(N * (N - 1) // 2): f, i, j = heappop(hq) upd(i, j) g = gcd(f.x, f.y) print(f.x // g, f.y // g)