There are N integers a_1, a_2, ..., a_N not less than 1. The values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \times a_2 \times ... \times a_N = P.  Find the maximum possible greatest common divisor of a_1, a_2, ..., a_N.
# caddi2018C - Product and GCD
def count_divisors(num: int) -> int:
    max_prime = 0
    ret = {}  

    # Divide num by 2 as much as possible
    cnt = 0
    while num % 2 == 0:
        num //= 2
        cnt += 1
    if cnt > 0:
        max_prime = 2
        ret[max_prime] = cnt

    # num must be odd -> skip even numbers
    cnt = 0
    for i in range(3, int(num ** 0.5) + 1, 2):
        cnt = 0
        while num % i == 0:
            num //= i
            max_prime = i
            cnt += 1
        if cnt > 0:
            ret[max_prime] = cnt

    # To handle the case when n is prime greater than 2
    if num > 2:
        max_prime = num
        ret[max_prime] = 1

    return ret


def main():
    n, p = list(map(int, input().rstrip().split()))
    print(count_divisors(p))
    ans = 1
    for f, p in count_divisors(p).items():
        ans *= f ** (p // n)  
    print(ans)


if __name__ == "__main__":
    main()
# caddi2018C - Product and GCD
def count_divisors(num: int) -> int:
    max_prime = 0
    ret = {}  

    # Divide num by 2 as much as possible
    cnt = 0
    while num % 2 == 0:
        num //= 2
        cnt += 1
    if cnt > 0:
        max_prime = 2
        ret[max_prime] = cnt

    # num must be odd -> skip even numbers
    cnt = 0
    for i in range(3, int(num ** 0.5) + 1, 2):
        cnt = 0
        while num % i == 0:
            num //= i
            max_prime = i
            cnt += 1
        if cnt > 0:
            ret[max_prime] = cnt

    # To handle the case when n is prime greater than 2
    if num > 2:
        max_prime = num
        ret[max_prime] = 1

    return ret


def main():
    n, p = list(map(int, input().rstrip().split()))
    ans = 1
    for f, p in count_divisors(p).items():
        ans *= f ** (p // n)  
    print(ans)


if __name__ == "__main__":
    main()