#include<iostream> #include<math.h> #include<string> #include<algorithm> using namespace std; typedef long long ll; const int N=1e5+10; int n; ll gcd(ll a,ll b) { return b?gcd(b,a%b):a; } void solve() { int a,b,c,d; cin>>a>>b>>c>>d; bool fg=false; ll p=a*1ll*b; for(int i=a+1;i<=c;i++) { ll t=p/gcd(p,i); ll j=(b/t+1)*1ll*t; if(j<=d) { printf("%d %d\n",i,j); fg=true; break; } if(fg) break; } if(!fg) puts("-1 -1"); } int main() { int T; cin>>T; while(T--) solve(); return 0; }