output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N P
attempt: import sys
  
  sys.setrecursionlimit(10**5 + 10)
  
  
  def input():
      return sys.stdin.readline().strip()
  
  
  def resolve():
      n, p = map(int, input().split())
      import math
  
      # cf. https://qiita.com/suecharo/items/14137fb74c26e2388f1f
  
      def make_prime_list_2(num):
          if num < 2:
              return []
  
          # 0のものは素数じゃないとする
          prime_list = [i for i in range(num + 1)]
          prime_list[1] = 0  # 1は素数ではない
          num_sqrt = math.sqrt(num)
  
          for prime in prime_list:
              if prime == 0:
                  continue
              if prime > num_sqrt:
                  break
  
              for non_prime in range(2 * prime, num, prime):
                  prime_list[non_prime] = 0
  
          return [prime for prime in prime_list if prime != 0]
  
      def prime_factorization_2(num):
          """numの素因数分解
          素因数をkeyに乗数をvalueに格納した辞書型dict_counterを返す"""
  
          if num <= 1:
              # 例えば1を食ったときの対処の仕方は問題によって違うと思うのでそのつど考える。
              # cf. https://atcoder.jp/contests/abc110/submissions/12688244
              return False
          else:
              num_sqrt = math.floor(math.sqrt(num))
              prime_list = make_prime_list_2(num_sqrt)
  
              dict_counter = (
                  {}
              )  # 何度もこの関数を呼び出して辞書を更新したい時はこれを引数にして
              # cf. https://atcoder.jp/contests/arc034/submissions/12251452
  
              for prime in prime_list:
                  while num % prime == 0:
                      if prime in dict_counter:
                          dict_counter[prime] += 1
                      else:
                          dict_counter[prime] = 1
                      num //= prime
              if num != 1:
                  if num in dict_counter:
                      dict_counter[num] += 1
                  else:
                      dict_counter[num] = 1
  
              return dict_counter
  
      if p != 1:
          d = prime_factorization_2(p)
          ans = 1
          for k, v in d.items():
              if v >= n:
                  ans *= k ** (v // n)
          print(ans)
      else:
          print(1)
  
  
  resolve()
  
problem_description: Statement
  
  There are N integers a_1, a_2, ..., a_N not less than 1. The values of a_1,
  a_2, ..., a_N are not known, but it is known that a_1 \times a_2 \times ...
  \times a_N = P.
  
  Find the maximum possible greatest common divisor of a_1, a_2, ..., a_N.
samples: [{"input": "3 24", "output": "2\n    \n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and\na_3=2.\n\n* * *"}, {"input": "5 1", "output": "1\n    \n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4\n= a_5 = 1.\n\n* * *"}, {"input": "1 111", "output": "111\n    \n\n* * *"}, {"input": "4 972439611840", "output": "206"}]