text: 
  #include <bits/stdc++.h>
  using namespace std;
  bool isPrime(int n)
  {
      if (n <= 1)
          return false;
      if (n <= 3)
          return true;
      if (n % 2 == 0 || n % 3 == 0)
          return false;
      for (int i = 5; i * i <= n; i = i + 6)
          if (n % i == 0 || n % (i + 2) == 0)
              return false;
      return true;
  }
  
  void printPrime(int n)
  {
      int result = 1;
      for (int i = 2; i <= n; i++)
          if (isPrime(i))
              result*=pow(i,int(log(n)/log(i)));
      printf("%d\n",result);
  
  }
  
  int main()
  {
    int k,inp;
    cin>>k;
    while(k--)
    {
      cin>>inp;
      printPrime(inp);
    }
    return 0;
  
  }
  