q = int(input()) from collections import defaultdict dict = defaultdict(lambda: 1) for now in range(2, 10**6+1): tmp = now * now cnt = 2 while tmp <= 10**12: dict[tmp] = max(dict[tmp], cnt) cnt += 1 tmp *= now M = [int(input()) for _ in range(q)] for n in M: print(dict[n])