#include <bits/stdc++.h>
using namespace std;

#define mem(x, y) memset(x, y, sizeof(x))
#define PI acos(-1.00)
#define ERR 1e-9
#define __                        \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);
#define file                           \
    freopen("input.txt", "rt", stdin); \
    freopen("output.txt", "wt", stdout);
#define MAX 1001010
const int inf = 0x7FFFFFFF;
typedef long long ll;

ll _GCD(ll a, ll b) { return b ? _GCD(b, a % b) : a; } //gcd

ll mark[MAX];
vector<ll> Prime;

void sieve()
{
    mem(mark, 0);
    mark[0] = mark[1] = 1;
    for (int i = 4; i < MAX; i += 2)
        mark[i] = 1;
    Prime.push_back(2);
    for (int i = 3; i < MAX; i += 2)
    {
        if (!mark[i])
        {
            Prime.push_back(i);
            for (int j = i * i; j < MAX; j += 2 * i)
            {
                mark[j] = 1;
            }
        }
    }
}
ll N, P;

//prototypes
ll solution();

int main()
{
    //__;
    //file;
    int tc = 1, cas = 0;
    sieve();
    //cin>>tc;
    while (tc--)
    {
        //printf("Case %d: ",++cas);
        solution();
    }
    return 0;
}

ll solution()
{
    cin >> N >> P;
    if (N == 1)
    {
        cout << P;
        return 0;
    }
    ll ans = 1;
    ll lim = sqrt(P);
    for (int i = 0;i!=Prime.size()&& Prime[i] <= lim; i++)
    {

        if(P%Prime[i]==0){
            ll count = 0;
            while (P % Prime[i] == 0)
            {
                P /= Prime[i];
                count++;
            }
            lim = sqrt(P);
            count /= N;
            if (count)
                ans *=pow(Prime[i], count);
        }
    }
    cout << ans;

    return 0;
}
