import java.util.Arrays;
public class Main {
public static void main
(String[] args
) { int v = 115;
int[] primes = getPrimes(v + 1);
for (int i
= 0; primes
[i
] <= Math.
sqrt(v
); i
++) { int n = primes[i];
if (v % n == 0) {
int m = v / primes[i];
if (Arrays.
binarySearch(primes, m
) >= 0) { System.
out.
println(n
+ ", " + m
); break;
}
}
}
}
static int[] getPrimes(int count) {
int[] a = new int[count];
a[0] = -1;
a[1] = -1;
int c = 0;
for (int i = 0; i < a.length; i++) {
if (a[i] != -1) {
c += 1;
for (int j = i + i; j < a.length; j += i) {
a[j] = -1;
}
}
}
int b[] = new int[c];
int j = 0;
for (int i = 0; i < a.length; i++) {
if (a[i] == 0) {
b[j] = i;
j += 1;
}
}
return b;
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheXM7CgpwdWJsaWMgY2xhc3MgTWFpbiB7CiAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgaW50IHYgPSAxMTU7CiAgICBpbnRbXSBwcmltZXMgPSBnZXRQcmltZXModiArIDEpOwogICAgZm9yIChpbnQgaSA9IDA7IHByaW1lc1tpXSA8PSBNYXRoLnNxcnQodik7IGkrKykgewogICAgICBpbnQgbiA9IHByaW1lc1tpXTsKICAgICAgaWYgKHYgJSBuID09IDApIHsKICAgICAgICBpbnQgbSA9IHYgLyBwcmltZXNbaV07CiAgICAgICAgaWYgKEFycmF5cy5iaW5hcnlTZWFyY2gocHJpbWVzLCBtKSA+PSAwKSB7CiAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4obiArICIsICIgKyBtKTsKICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgfQogICAgfQogIH0KICAKICBzdGF0aWMgaW50W10gZ2V0UHJpbWVzKGludCBjb3VudCkgewogICAgaW50W10gYSA9IG5ldyBpbnRbY291bnRdOwogICAgYVswXSA9IC0xOwogICAgYVsxXSA9IC0xOwogICAgaW50IGMgPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhLmxlbmd0aDsgaSsrKSB7CiAgICAgIGlmIChhW2ldICE9IC0xKSB7CiAgICAgICAgYyArPSAxOwogICAgICAgIGZvciAoaW50IGogPSBpICsgaTsgaiA8IGEubGVuZ3RoOyBqICs9IGkpIHsKICAgICAgICAgIGFbal0gPSAtMTsKICAgICAgICB9CiAgICAgIH0KICAgIH0KICAgIGludCBiW10gPSBuZXcgaW50W2NdOwogICAgaW50IGogPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhLmxlbmd0aDsgaSsrKSB7CiAgICAgIGlmIChhW2ldID09IDApIHsKICAgICAgICBiW2pdID0gaTsKICAgICAgICBqICs9IDE7CiAgICAgIH0KICAgIH0KICAgIHJldHVybiBiOwogIH0KfQ==