package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	var p int

	fmt.Scan(&n)
	fmt.Scan(&p)

	if n == 1 {
		fmt.Println(p)
		return
	}

	result := p
	end := int(math.Pow(float64(p), float64(1.0)/float64(n)))
	fmt.Println(end)
	for i := 1; i <= end; i++ {
		pow := int(math.Floor((math.Pow(float64(i), float64(n)))))
		if (p % pow) == 0 {
			result = i
		}
	}
	fmt.Println(result)
}
