#include <iostream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <cmath> #include <stdio.h> #include <queue> #include <deque> #include <cstdio> #include <set> #include <map> #include <bitset> #include <stack> #include <cctype> using namespace std; long long p[12] = { 2,3,5,7,11,13,17,19,23,29,31,37 }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; for (int i = 0; i < t; i++) { long long x, x1; cin >> x; long long ans = 100000000000000; int co[12] = {}, co1[12] = {}; for (long long j = 2; j < 35; j++) { for (int k = 0; k < 12; k++) { x1 = x; co[k] = 1; while (x1 % p[k] == 0) { x1 /= p[k]; co[k]++; } co1[k] = co[k]; } for (int k = 0; k < 12; k++) { x1 = j; while (x1 % p[k] == 0) { x1 /= p[k]; co1[k]++; } } long long c = 1, c1 = 1; for (int k = 0; k < 12; k++) { c *= co[k]; c1 *= co1[k]; } if (c * 2 == c1) { ans = min(ans, x * j); } } cout << ans << endl; } }