#include using namespace std; int main() { int T; cin >> T; while (T--) { long long X; cin >> X; vectorprime = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97}; long long ans = 1001001001001001001; for(int i = 0; i < prime.size(); i++) { long long cnt = X*prime[i]; long long Y = X; bool flag = false; while (Y%prime[i] == 0) { Y /= prime[i]; if(1001001001001001001LL/prime[i] < cnt) { flag = true; } cnt *= prime[i]; } if(flag) { continue; } ans = min(ans,cnt); } cout << ans << endl; } }