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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
import java.util.StringTokenizer;
import java.io.PrintWriter;
public class q2 {
	public static void main(String[] args) {
		InputReader s = new InputReader(System.in);
		PrintWriter o = new PrintWriter(System.out);
		long n=s.nextLong();
		int k=s.nextInt();
		ArrayList<Long> ar=new ArrayList<>();
		 for (long i=1; i<=Math.sqrt(n); i++)
		    {
		        if (n%i==0)
		        {
		            // If divisors are equal, print only one
		            if (n/i == i)
		                ar.add((long)i);
		 
		            else // Otherwise print both
		                {
		            	ar.add((long)i);
		            	ar.add((long)n/i);
		                }
		                
		        }
		    }
		Collections.sort(ar);
	//o.println(ar);
		 if(ar.size()>=k){
			 o.println(ar.get(k-1));
		 }
		 else o.println("-1");
		o.close();
	}

	static long GCD, Xinv, Yinv;

	static void gcd(long a, long b) {
		if (b == 0) {
			GCD = a;
			Xinv = 1;
			Yinv = 0;
		} else {
			gcd(b, a % b);
			long temp = Xinv;
			Xinv = Yinv;
			Yinv = temp - (a / b) * Yinv;
		}
	}

	static long modInverse(long a, long m) {
		gcd(a, m);
		return (Xinv % m + m) % m;
	}

	static long m = 1000000007;

	static long modularExpnentiation(long x, long y) {
		if (y == 0)
			return 1;
		if (y % 2 == 0)
			return modularExpnentiation((x * x) % m, y / 2);
		else
			return (x * modularExpnentiation(x, y - 1)) % m;
	}

	static int minPrime[];
	static long fac[], invfac[];

	static void facmod(int n, long m) {
		fac = new long[n + 1];
		invfac = new long[n + 1];
		fac[0] = 1;
		invfac[0] = 1;
		for (int i = 1; i <= n; i++) {
			fac[i] = (fac[i - 1] * i) % m;
		}
		invfac[n] = modInverse(fac[n], m);
		for (int i = n - 1; i >= 0; i--)
			invfac[i] = ((i + 1) * invfac[i + 1]) % m;
	}

	static void sieve(int n) {

		minPrime = new int[n + 1];
		for (int i = 2; i * i <= minPrime.length - 1; ++i) {
			if (minPrime[i] == 0) { //If i is prime
				for (int j = i * i; j <= minPrime.length - 1; j += i) {
					if (minPrime[j] == 0) {
						minPrime[j] = i;
					}
				}
			}
		}
		for (int i = 2; i <= minPrime.length - 1; ++i) {
			if (minPrime[i] == 0) {
				minPrime[i] = i;
			}
		}
	}

	static boolean checkprime(int N) {
		int count = 0;
		for (int i = 1; i * i <= N; ++i) {
			if (N % i == 0) {
				if (i * i == N)
					count++;
				else // i < sqrt(N) and (N / i) > sqrt(N)
					count += 2;
			}
			if (count > 2)
				break;
		}
		if (count == 2)
			return true;
		else
			return false;
	}

	static HashSet<Integer> factorize(int n) {
		HashSet<Integer> res = new HashSet<>();
		while (n != 1) {
			int x = minPrime[n];
			res.add(x);
			n /= minPrime[n];
		}
		return res;
	}

	static HashMap<Long, Integer> Primefactorize(long n) {
		HashMap<Long, Integer> res = new HashMap<Long, Integer>();
		for (long i = 2; i * i <= n; ++i) {
			while (n % i == 0) {
				if (res.containsKey(i)) {
					int x = res.get(i);
					res.put(i, x + 1);
				} else {
					res.put(i, 1);
				}
				n /= i;
			}
			if (n == 1)
				break;
		}
		if (n != 1) {
			res.put(n, 1);
		}
		return res;
	}

	public static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}

		public String nextLine() {
			String fullLine = null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine = reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}