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:

/*


		HARSH KHATRI
		DA-IICT

                      */

import java.io.*;
import java.util.*;
import java.util.Scanner;
import java.util.Arrays;

public class CF762A {
	public static void main(String[] args) {

		FasterScanner in = new FasterScanner();
		long n = in.nextLong();
		int k = in.nextInt();
		long i; int j=0, p = 1, q;
		int[] factors = new int[1000000];

		for(i=1; i*i<=n; i++) {
			if(n%i==0) {
				factors[j] = (int)i;
				p = (int)i;
				j++;
			}
		}

		if(k <=j ) { System.out.println(factors[k-1]); }
		else {
			if(p==(n/p)) k++;
			if( k>j && k<=(2*j) ) {
				System.out.println((n/factors[2*j-k]));
			}
			else {
				System.out.println(-1);
			}
		}

	}
}



class FasterScanner {
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int snumChars;

	    public int read() {
	      if (snumChars == -1)
		throw new InputMismatchException();
	      if (curChar >= snumChars) {
		curChar = 0;
		try {
		  snumChars = System.in.read(buf);
		} catch (IOException e) {
		  throw new InputMismatchException();
		}
		if (snumChars <= 0)
		  return -1;
	      }
	      return buf[curChar++];
	    }

	    public double nextDouble() {
	      return Double.parseDouble(this.nextString());
	    }

	    public String nextLine() {
	      int c = read();
	      while (isSpaceChar(c))
		c = read();
	      StringBuilder res = new StringBuilder();
	      do {
		res.appendCodePoint(c);
		c = read();
	      } while (!isEndOfLine(c));
	      return res.toString();
	    }

	    public String nextString() {
	      int c = read();
	      while (isSpaceChar(c))
		c = read();
	      StringBuilder res = new StringBuilder();
	      do {
		res.appendCodePoint(c);
		c = read();
	      } while (!isSpaceChar(c));
	      return res.toString();
	    }

	    public long nextLong() {
	      int c = read();
	      while (isSpaceChar(c))
		c = read();
	      int sgn = 1;
	      if (c == '-') {
		sgn = -1;
		c = read();
	      }
	      long res = 0;
	      do {
		if (c < '0' || c > '9')
		  throw new InputMismatchException();
		res *= 10;
		res += c - '0';
		c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }

	    public int nextInt() {
	      int c = read();
	      while (isSpaceChar(c))
		c = read();
	      int sgn = 1;
	      if (c == '-') {
		sgn = -1;
		c = read();
	      }
	      int res = 0;
	      do {
		if (c < '0' || c > '9')
		  throw new InputMismatchException();
		res *= 10;
		res += c - '0';
		c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }

	    public int[] nextIntArray(int n) {
	      int[] arr = new int[n];
	      for (int i = 0; i < n; i++) {
		arr[i] = nextInt();
	      }
	      return arr;
	    }

	    public long[] nextLongArray(int n) {
	      long[] arr = new long[n];
	      for (int i = 0; i < n; i++) {
		arr[i] = nextLong();
	      }
	      return arr;
	    }

	    private boolean isSpaceChar(int c) {
	      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }

	    private boolean isEndOfLine(int c) {
	      return c == '\n' || c == '\r' || c == -1;
	    }
}