#include using namespace std; #define bokusunny ios::sync_with_stdio(false), cin.tie(nullptr); bool is_prime(long long x) { if (x == 1) return false; long long i = 2; while (i * i <= x) { if (x % i == 0) return false; i++; } return true; } void solve() { int T; cin >> T; vector Primes; for (int i = 2; i < 60; i++) { if (is_prime(i)) Primes.emplace_back(i); } int sz = (int)Primes.size(); while (T--) { long long x; cin >> x; long long xx = x; vector Cnt(sz); for (int i = 0; i < sz; i++) { while (x % Primes[i] == 0) { Cnt[i]++; x /= Primes[i]; } } const int inf = 100; long long mul = inf; for (int i = 0; i < sz; i++) { long long tmp = 1; for (int j = 0; j <= Cnt[i]; j++) tmp *= Primes[i]; mul = min(mul, tmp); } cout << xx * mul << endl; } } int main() { bokusunny; solve(); return 0; }