#include<cstdio>
long long p,ans=1;
int n;
int main()
{
	scanf("%d%lld",&n,&p);
	for (int i=2;i*i<=p;i++)
	{
		int cnt=0;
		while (p%i==0) ++cnt,p=p/i;
		for (int j=1;j*n<=cnt;j++) ans=ans*i;
	}
	if (p!=1&&n==1) ans=ans*p,p=1;
	printf("%lld\n",ans);
}