#include using namespace std; typedef long long ll; ll n,m; map > q; int a[555]; inline bool JudgePrime(ll digit) { if(digit==2 || digit==3)return true; else if(digit<=1 || digit%2==0)return false; else if(digit>3) { for(int i=3; i*i<=digit; i+=2)if(digit%i==0)return false; return true; } } int main() { int t; cin>>t; while(t --){ cin>>n>>m; if(n==m){ if(n==1) { cout<<"-1 -1"<<'\n'; }else { cout<<"2 "<