main = do
    [n,p] <- ((fmap read . words) <$> getLine) :: IO [Int]
    print $ solve n p (ceiling $ nroot n p)


nroot :: Int -> Int -> Double
nroot n x = ((fromIntegral x) ** (1/(fromIntegral n)))

solve n p ac =
    case p `mod` ac^n == 0 of
        True  -> ac
        False -> solve n p (ac-1)