from collections import defaultdict import heapq h = [] Prime = [1 for i in range(10**5+1)] Prime[0] = Prime[1] = 0 for i in range(2,10**5+1): if Prime[i] == 1: for j in range(2, 10**5): if i*j <= 10**5: Prime[i*j] = 0 else: break D = defaultdict( int) N, K = map( int, input().split()) A = [] now = N for i in range(2, 10**5): if now == 1: break while now%i == 0: now //= i A.append(i) D[i] += 1 def check(d): ret = 0 for f in d: ret += d[f] return(ret) ans = 1 E = defaultdict( int) while check(E) < K: for f in D: if D[f] >= 1: E[f] += 1 D[f] -= 1 if check(E) >= K: break for f in E: ans *= f**E[f] t = 2 for i in range(10**5+1): if Prime[i] == 1: if E[i] == 0: if ans*i < N: ans *= i else: break for i in range(1,17): for j in range(2, 10**5+1): if Prime[j] == 1: if E[j] <= i: if ans*j < N: ans *= j else: break if ans*2 >= N: break print( ans)