#昨天没有AC 只通过20% n = int(raw_input()) m = [] for i in range(n): m.append(int(raw_input())) for a in m: if a % 2 != 0: print "No" else: aa = a / 2 for i in range(2,aa): if (a % i == 0): b = a / i if b % 2 != 0: print str(b)+' '+str(i) break i += 2