from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,datetime sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, input().split())) def inpls(): return list(input().split()) N = int(input()) aa = inpl() #素因数分解 def factors_nojit(n): gaps = [1,2,2,4,2,4,2,4,6,2,6] length, cycle = 11, 3 f, fs, nxt = 2, [], 0 while f * f <= n: while n % f == 0: fs.append(f) n0 = n n //= f f += gaps[nxt] nxt += 1 if nxt == length: nxt = cycle if n > 1: fs.append(n) return fs cnts = [defaultdict(int) for i in range(N)] ed = set() for i,a in enumerate(aa): fs = factors_nojit(a) for p in fs: ed.add(p) cnts[i][p] += 1 y = 1 for p in ed: np = INF for i in range(N): np = min(cnts[i][p],np) y *= pow(p,np) ans = list(map(str,map(lambda x:x//y,aa))) print(':'.join(ans))