Problem: You are given two integers n and k. Find k-th smallest divisor of n, or report that it doesn't exist.

Divisor of n is any such natural number, that n can be divided by it without remainder.

Input

The first line contains two integers n and k (1 ≤ n ≤ 1015, 1 ≤ k ≤ 109).

Output

If n has less than k divisors, output -1.

Otherwise, output the k-th smallest divisor of n.

Examples

Input

4 2


Output

2


Input

5 3


Output

-1


Input

12 5


Output

6

Note

In the first example, number 4 has three divisors: 1, 2 and 4. The second one is 2.

In the second example, number 5 has only two divisors: 1 and 5. The third divisor doesn't exist, so the answer is -1.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
public class Main
{
    static BufferedReader reader;
    static StringTokenizer tokenizer;
    static void init(InputStream input)
    {
        reader = new BufferedReader( new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
    static String next() throws IOException
    {
        while ( ! tokenizer.hasMoreTokens() )
        {
            tokenizer = new StringTokenizer(reader.readLine() );
        }
        return tokenizer.nextToken();
    }
 
    static long nextInt() throws IOException
    {
        return Long.parseLong( next() );
    }
    static PrintWriter writer;
    static void outit(OutputStream outputStream)
    {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }
    static void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }
 
    static void println(Object...objects) {
        print(objects);
        writer.println();
    }
 
    static void close() {
        writer.close();
    }
 
    static void flush() {
        writer.flush();
    }
    static ArrayList<ArrayList<Integer>> sieve ;
    static long [] mob ;
    public static void main(String [] args) throws IOException
    {
        init(System.in) ;
        outit(System.out) ;
//    	int t = (int)nextInt() ;
//    	for(int i =0 ; i<t ; i++)
        output() ;
        flush();
        close();
    }
    public static int ri() throws IOException
    {
    	return (int)nextInt() ;
    }
    public static long rl() throws IOException
    {
    	return nextInt() ;
    }
    public static double rd() throws NumberFormatException, IOException
    {
    	return Double.parseDouble(next()) ;
    }
    static void print_a(long [] arr)
    {
    	for(int i = 0 ;i<arr.length ; i++)
    	{
    		print(arr[i]+" ") ;
    	}
    	println() ;
    }
    public static int [] ria() throws IOException
    {
    	int n = ri() ;
    	int [] a = new int[n] ;
    	for(int i = 0 ; i<n ; i++)
    	{
    		a[i] = ri() ;
    	}
    	return a ;
    }
    public static long [] rla() throws IOException
    {
    	int n = ri() ;
    	long [] a = new long[n] ;
    	for(int i =0 ; i<n ; i++)
    	{
    		a[i] = rl() ;
    	}
    	return a ;
    }
    public static int p(int i)
    {
    	return (int)Math.pow(2,i) ;
    }
    static long mod = 1000000007 ;
    static long [][][] cache ;
    static int [] c_x ;
    static int [] c_y ;
    static int [] a ;
    static double PI = 3.14159 ;
    public static void output() throws IOException
    {
    	long n = rl() ;
    	long k =  rl() ;
    	long ctr = 0; 
    	PriorityQueue<Long> pq = new PriorityQueue<Long>() ;
    	for(long i = 1; i<=(long)Math.sqrt(n) ; i++)
    	{
    		if(n%i==0)
    		{
    		if(i*i==n)
    		{
    			pq.add(i) ;
    		}
    		else
    		{
    			pq.add(i) ;
    			pq.add(n/i) ;
    		}
    		}
    	}
    	if(pq.size()<k)
    	{
    		println(-1) ;
    		return  ;
    	}
    	while(!pq.isEmpty())
    	{
    		long div  = pq.poll() ;
    		ctr++ ;
    		if(ctr==k)
    		{
    			println(div) ;
    			return  ;
    		}
    	}
    }
}