#include using namespace std; int main() { int T; cin >> T; 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}; while (T--) { long long X; cin >> X; long long ans = 1001001001001001001; for(int i = 2; i <= 70; i++) { long long tmp1 = 1,tmp2 = 1; for(int j = 0; j < prime.size(); j++) { long long Y = X,Z = i; int y = 0,z = 0; while (Y%prime[j] == 0) { Y /= prime[j]; y++; } while (Z%prime[j] == 0) { Z /= prime[j]; z++; } tmp1 *= y+1; tmp2 *= y+z+1; } if(tmp1*2 == tmp2) { ans = min(ans,X*i); } } cout << ans << endl; } }