#include #include #include #include #include #include #include #include int main() { using namespace std; using lint = long long; auto solve = [] { lint n, l, r; cin >> n >> l >> r; vector> pe; { lint nn = n; for (lint p = 2; p * p <= nn; ++p) { if (nn % p) continue; int e = 0; int p_e = 1; while (nn % p == 0) { nn /= p; e++; p_e *= p; } pe.emplace_back(p, e, p_e); } if (nn > 1) pe.emplace_back(nn, 1, nn); } int m = pe.size(); vector divisors0{1}; { for (auto [p, e, p_e] : pe) { int s = divisors0.size(); for (int i = 0; i < s; ++i) for (int pei = p; pei <= p_e; pei *= p) divisors0.push_back(divisors0[i] * pei); } } if (divisors0.size() < 3) { puts("-1"); return; } vector> ok(1 << m); for (auto d : divisors0) { if (d < l || d > r) continue; int bit = 0; for (int i = 0; i < m; ++i) { auto [p, e, p_e] = pe[i]; if (d % p_e == 0) bit |= 1 << i; } if (ok[bit].size() < 3) { for (int sub = 0;; sub = (sub - bit) & bit) { if (ok[sub].size() < 3) ok[sub].push_back(d); if (sub == bit) break; } } } // for (int i = 0; i < (1 << m); ++i) { // if (ok[i].empty()) continue; // cout << format("{:09b}:", i); // for (auto e : ok[i]) cout << " " << e; // cout << "\n"; // } auto shout = [&](lint a, lint b, lint c) { if (a == b || a == c || b == c) return false; vector ans{a, b, c}; ranges::sort(ans); if (!(l <= ans[0])) return false; if (!(ans[0] < ans[1])) return false; if (!(ans[1] < ans[2])) return false; if (!(ans[2] <= r)) return false; lint ll = lcm(lcm(ans[0], ans[1]), ans[2]); if (!(ll == n)) return false; cout << ans[0] << " " << ans[1] << " " << ans[2] << "\n"; return true; }; int full = (1 << m) - 1; for (int bit_a = 1 << m - 1; bit_a < (1 << m); ++bit_a) { if (ok[bit_a].empty()) continue; int rem = bit_a ^ full; for (int bit_b = 0;; bit_b = (bit_b - full) & full) { int bit_c = bit_b ^ rem; if (!ok[bit_b].empty() && !ok[bit_c].empty()) { for (lint da : ok[bit_a]) for (lint db : ok[bit_b]) for (lint dc : ok[bit_c]) { if (shout(da, db, dc)) return; } } if (bit_b == full) break; } } puts("-1"); }; int ct; cin >> ct; while (ct--) { solve(); } }