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