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.*;
import java.util.*;
import java.math.*;

 public  class PRABHATLONGCONTEST{
    final int M = (int) 1e9 + 7;
    int md=(int)(1e7+1);
     int[] SMP=new int[md];
    final double eps = 1e-6;
    final double pi = Math.PI;
    final long inf = Long.MAX_VALUE / 2;
    boolean P[] = new boolean[10000001] ;
     public static int LPFAC[] = new int[10000001];
    //------------> Solution starts here!!
    @SuppressWarnings("Main Logic")
 void solve()
 {
  // Sieve();
      long n=il();
    	int k=ii();
    	TreeSet<Long> t= new TreeSet<Long>();
        for(long i=1;i<=(long)Math.sqrt(n);i++)
        {
			if(n%i==0){ t.add(i); t.add(n/i);}
		}
		int c=0;
		for(long g:t)
		{
			c++;
			if(c==k){ out.println(g); return ;}
		}
		out.println("-1");

}
    //------------> Solution ends here!!
    InputStream obj;
    PrintWriter out;
    String check = "";

    public static void main(String[] args) throws IOException
    {    new Thread(null, new Runnable() {
            public void run() {
                try {
                    new PRABHATLONGCONTEST().main1();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (StackOverflowError e) {
                    System.out.println("RTE");
                }
            }
        }, "1", 1 << 26).start();
    }

   void main1() throws IOException {
        out = new PrintWriter(System.out);
        obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
        // obj=check.isEmpty() ? new FileInputStream("/home/input.txt") : new ByteArrayInputStream(check.getBytes());
        solve();
        out.flush();
        out.close();
    }

    byte inbuffer[] = new byte[1024];
    int lenbuffer = 0, ptrbuffer = 0;

    int readByte() {
        if (lenbuffer == -1) throw new InputMismatchException();
        if (ptrbuffer >= lenbuffer) {
            ptrbuffer = 0;
            try {
                lenbuffer = obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if (lenbuffer <= 0) return -1;
        return inbuffer[ptrbuffer++];
    }
     public String readLine() {
		        int c = readByte();
		        while (isSpaceChar(c))
		            c = readByte();
		        StringBuilder res = new StringBuilder();
		        do {
		            res.appendCodePoint(c);
		            c = readByte();
		        } while (!isEndOfLine(c));
		        return res.toString();
    }
    public boolean isEndOfLine(int c) {
	        return c == '\n' || c == '\r' || c == -1;
    }

    String is() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) // when nextLine, (isSpaceChar(b) && b!=' ')
        {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

 public   int ii() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    long il() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    boolean isSpaceChar(int c) {
        return (!(c >= 33 && c <= 126));
    }


      int skip()
        {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
        }

    float nf() {
        return Float.parseFloat(is());
    }

    double id() {
        return Double.parseDouble(is());
    }

    char ic() {
        return (char) skip();
    }

    int[] iia(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) a[i] = ii();
        return a;
    }

    long[] ila(int n) {
        long a[] = new long[n];
        for (int i = 0; i < n; i++) a[i] = il();
        return a;
    }

    String[] isa(int n) {
        String a[] = new String[n];
        for (int i = 0; i < n; i++) a[i] = is();
        return a;
    }

    int gcd(int a,int b)
    {
		if(a==0)
		return b;
		else  return gcd(b%a,a);

		}
	 long mul(long a, long b) { return a * b % M; }
	 long pow(long a, long k)
	 {
				if (k == 0)
					return 1;
				long p = pow(a, k / 2);
				p = mul(p, p);
				if (k % 2 == 1)
					p = mul(p, a);
				return p;

	}

		long div(long a, long b)
			 {
				return mul(a, pow(b, M - 2));

	           }

     public int[] Characterfrequency(String S)
     {
		 int[] F=new int[256];
		 for(int i=0;i<S.length();i++)
		 {
			 F[(int)S.charAt(i)]++;

		 }
           return F;
	}

public  int[] radixSort(int[] f)
{
	int[] to = new int[f.length];
	{
		int[] b = new int[65537];
		for(int i = 0;i < f.length;i++)b[1+(f[i]&0xffff)]++;
		for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
		for(int i = 0;i < f.length;i++)to[b[f[i]&0xffff]++] = f[i];
		int[] d = f; f = to;to = d;
	}
	{
		int[] b = new int[65537];
		for(int i = 0;i < f.length;i++)b[1+(f[i]>>>16)]++;
		for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
		for(int i = 0;i < f.length;i++)to[b[f[i]>>>16]++] = f[i];
		int[] d = f; f = to;to = d;
	}
	return f;
}
void Sieve(){
 		Arrays.fill(P,true) ;
 		Arrays.fill(LPFAC,0);
 		P[0]=false ;
 		P[1]=false ;
 		for(int i=2 ; i<=10000000 ; i++)
 		   {
 			if(P[i])
 			 {
 				//int j=i*i ;
 				LPFAC[i]=i;
 				for(int j=2;i*j<=10000000;j++)
 				{
					P[i*j]=false;
					if(LPFAC[i*j]==0)LPFAC[i*j]=i;

				}

 			 }
 		  }
	}
public    int[] LPFAC(int max,int[] SMP)
    {
		Arrays.fill(SMP,0);
        for(int i=2;i<max;i++)
        {

			if(SMP[i]==0)
			SMP[i]=i;

			for(int j=i;j<max;j+=i)
			{
			  if(SMP[j]==0) SMP[j]=i;

			}
		}
       return SMP;
     }




    double[][] idm(int n, int m) {
        double a[][] = new double[n][m];
        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = id();
        return a;
    }

    int[][] iim(int n, int m) {
        int a[][] = new int[n][m];
        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = ii();
        return a;
    }









}