#include #define int long long using namespace std; const int maxn=1005; const int mode=1e9+7; int read(){ int x=0,f=1;char ch=getchar(); while(!isdigit(ch)){ if(ch=='-') f=-1; ch=getchar(); } while(isdigit(ch)){ x=x*10+ch-'0'; ch=getchar(); } return x*f; } int t,n,m,a,b; signed main(){ t=read(); while(t--){ a=read(); b=read(); int temp=abs(a-b); if(temp==1){ cout<<-1<<' '<<-1<<"\n"; continue; } else if(temp==0){ if(a==1) cout<<-1<<' '<<-1<<"\n"; else cout<<2<<' '<