#include #include #define chmin(x,y) (x) = min((x),(y)) #define chmax(x,y) (x) = max((x),(y)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define vec vector #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define pb push_back #define eb emplace_back using namespace std; using namespace atcoder; using ll = long long; using ld = long double; const ll mod = 998244353; using mint = modint998244353; const vector dx = {1,0,-1,0}, dy = {0,1,0,-1}; // using Graph = vector>>; using Graph = vector>; vec> pf(ll X){ if(X == 1) return {make_pair(1LL,1)}; vec> res; for(ll i = 2; i * i <= X; i++) if(X % i == 0){ int e = 0; while(X % i == 0){ X /= i; e++; } res.eb(i,e); } if(X != 1) res.eb(X,1); return res; } vector> get_divisors( ll N, ll L, ll R, vector> PF ){ int K = (int)PF.size(); vec> res; vec found(1<= 3) break; } return res; } int main(){ // input int T; cin >> T; while(T--){ ll N,L,R; cin >> N >> L >> R; auto PFN = pf(N); int K = PFN.size(); if(N == 1){ cout << -1 << endl; continue; } auto cand = get_divisors(N,L,R,PFN); bool found = 0; for(auto[a,x] : cand){ for(auto[b,y] : cand){ if(b <= a) continue; for(auto[c,z] : cand){ if(c <= b) continue; if(((x|y)|z) == (1<