import math import bisect def sieve_of_eratosthenes(n): prime = [True for i in range(n+1)] prime[0] = False prime[1] = False sqrt_n = math.ceil(math.sqrt(n)) for i in range(2, sqrt_n): if prime[i]: for j in range(2*i, n+1, i): prime[j] = False return prime # 素因数分解、辞書で返すやつ # mathをimportする def prime(n): factor = {} tmp = int(math.sqrt(n)) + 1 for num in range(2, tmp): while n % num == 0: n //= num if not num in factor.keys(): factor[num] = 1 else: factor[num] += 1 if num > n: break if n != 1: if not n in factor.keys(): factor[n] = 1 else: factor[n] += 1 return factor n,k = map(int,input().split()) dic = {} pr = prime(n) #print(pr) ls = [] for num,count in pr.items(): ls.append([num,count]) #print(num,count) ls.sort() ans = 1 cnt = k li = sieve_of_eratosthenes(n) ss = {} for p in range(n+1): if li[p]: ss[p] = 0 while cnt > 0: for i in ls: #print(i) if cnt == 0: break if i[1] == 0: continue else: i[1] -= 1 ss[i[0]] += 1 cnt -= 1 ans *= i[0] #print(ans) #exit() useli = [[] for i in range(21)] for num,count in ss.items(): useli[count].append(num) for i in range(21): useli[i].sort() for i in range(21): for j in useli[i]: if ans * j < n: ans *= j bisect.insort(useli[i+1],j) else: break print(ans)