#include #include #include #include #include using namespace std; using lli = long long int; using pii = std::pair; int main(){ lli t; cin >> t; for(int i = 0; i < t; i++) { lli x; cin >> x; // cout << x << endl;; bool flag = false; lli cnt = 0; lli ans = 1e9; for(lli j = 2; j <= 35 and not flag; j++) { if(x%j != 0){ ans = min(ans, j); flag = true; } } vector c(11, 0), d(11); d[0] = 2, d[1] = 3, d[2] = 5, d[3] = 7, d[4] = 11, d[5] = 13, d[6] = 17, d[7] = 19, d[8] = 23, d[9] = 29, d[10] = 31; for(int j = 0; j < c.size(); j++) { lli tmp = x; while(tmp%d[j] == 0){ tmp /= d[j]; c[j]++; } if(c[j] > 0) ans = min(ans, (lli)pow(d[j], (c[j]+1))); } cout << ans*x << endl; } }