local function pfact(x)
	local ret={}
	local c=0
	while(x%2==0)do c=c+1 x=x/2 end
	if(c~=0)then ret[2]=c end
	
	local i=3
	while(i*i<=x)do
		local c=0
		while(x%i==0)do c=c+1 x=x/i end
		if(c~=0)then ret[i]=c end
		i=i+2
	end
	ret[x]=(ret[x]or 0)+1
	return ret
end
N=io.read"*n"
P=io.read"*n"
r=1
for k,v in pairs(pfact(P))do
	r=r*k^math.floor(v/N)
end
print(r)