#include int main() { using namespace std; cin.tie(nullptr)->sync_with_stdio(false); int tt; cin >> tt; while (tt--) { int64_t x; cin >> x; int64_t mn = 1e18; for (int p : {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31}) { int64_t cur = p; for (auto t = x; t % p == 0; t /= p) cur *= p; mn = min(mn, cur); } cout << mn * x << '\n'; } }