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.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class KthDivisor762A {

    public static long solve3(long n, long k) {
        List<Long> ds = new ArrayList<>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                ds.add(i);
                ds.add(n / i);
            }
        }
        Set<Long> sp = new HashSet<>();
        sp.addAll(ds);
        if (sp.size() < k)
            return -1;
        ds = new ArrayList<>(sp);
        Collections.sort(ds);

        return ds.get((int) (k - 1));
    }

    public static long solve2(long n, long k) {

        List<Long> ds = new ArrayList<>();
        List<Long> ds2 = new ArrayList<>();
        long c = 0L;
        long c2 = n;
        long p = k;
        while (c < c2 && p > 0) {
            c++;
            if (n % c == 0) {
                c2 = n / c;
                ds.add(c);
                ds2.add(c2);
                --p;
            }
        }

        ds2.removeAll(ds);

        // System.out.println(ds);
        Collections.reverse(ds2);
        // System.out.println(ds2 + " - " + ds.size() + " - " + ds2.size());
        if (k > ds.size() + ds2.size())
            return -1;

        else if (k <= ds.size()) {

            return ds.get((int) (k - 1));
        } else if (k > ds.size() && k <= ds2.size() + ds.size()) {

            return ds2.get((int) (k - ds.size() - 1));
        }
        return 0;
    }

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long k = s.nextLong();
        // 179458711 2
        // long n = 5;// 999_999_999_999_9L;
        // long k = 3;// 897L;
        if (k > n)
            System.out.println("-1");
        else {
            /*
             * for (int i = 0; i < 1; i++) { long startTime = System.nanoTime()
             */
            // long startTime = System.nanoTime();
            System.out.println(solve3(n, k));

            // long endTime = System.nanoTime();
            // System.out.println("Time" + (endTime - startTime) / 1000_000 + "
            // ms");
        }

    }

}