program main
implicit None
	integer(8)::n,p,q,i
	
	read *,n,p
	
	if(n >= 40)then
		print 101,1
		stop
		else if(n ==1)then
			print 101,p
			stop
	endif 
	
	q = int(real(p)**(1.0/real(n))+0.00001)
	
	do i =  q,2,-1
		if(mod(p,i**n) == 0)then
			print 101,i
			stop
		endif
	enddo
	
	print 101,1
101 format(i0)
end program main
