#include #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef pair pll; template bool chkmax(T &x,T y){return x bool chkmin(T &x,T y){return x>y?x=y,true:false;} int readint(){ int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } const int cys=998244353; int a,b,n,m,k; int p[200005],p1[200005],p2[200005]; ll qpow(ll x,ll p){ ll ret=1; for(;p;p>>=1,x=x*x%cys) if(p&1) ret=ret*x%cys; return ret; } int main(){ int T=readint(); while(T--){ a=readint(); b=readint(); if(a<=1&&b<=1){ printf("-1 -1\n"); continue; } if(a==b){ printf("2 %d\n",a); continue; } if(ap[i]) continue; if(tmp==1) continue; chkmin(mina,tmp); chkmax(maxa,tmp); } } if(maxa<0) printf("-1 -1\n"); else printf("%d %d\n",mina,maxa); } return 0; }