1. //Utkarsh.25dec
  2. #include <bits/stdc++.h>
  3. #define ll long long int
  4. #define pb push_back
  5. #define mp make_pair
  6. #define mod 1000000007
  7. #define vl vector <ll>
  8. #define all(c) (c).begin(),(c).end()
  9. using namespace std;
  10. ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
  11. ll modInverse(ll a){return power(a,mod-2);}
  12. const int N=500023;
  13. bool vis[N];
  14. vector <int> adj[N];
  15. long long readInt(long long l,long long r,char endd){
  16. long long x=0;
  17. int cnt=0;
  18. int fi=-1;
  19. bool is_neg=false;
  20. while(true){
  21. char g=getchar();
  22. if(g=='-'){
  23. assert(fi==-1);
  24. is_neg=true;
  25. continue;
  26. }
  27. if('0'<=g && g<='9'){
  28. x*=10;
  29. x+=g-'0';
  30. if(cnt==0){
  31. fi=g-'0';
  32. }
  33. cnt++;
  34. assert(fi!=0 || cnt==1);
  35. assert(fi!=0 || is_neg==false);
  36.  
  37. assert(!(cnt>19 || ( cnt==19 && fi>1) ));
  38. } else if(g==endd){
  39. if(is_neg){
  40. x= -x;
  41. }
  42.  
  43. if(!(l <= x && x <= r))
  44. {
  45. cerr << l << ' ' << r << ' ' << x << '\n';
  46. assert(1 == 0);
  47. }
  48.  
  49. return x;
  50. } else {
  51. assert(false);
  52. }
  53. }
  54. }
  55. string readString(int l,int r,char endd){
  56. string ret="";
  57. int cnt=0;
  58. while(true){
  59. char g=getchar();
  60. assert(g!=-1);
  61. if(g==endd){
  62. break;
  63. }
  64. cnt++;
  65. ret+=g;
  66. }
  67. assert(l<=cnt && cnt<=r);
  68. return ret;
  69. }
  70. long long readIntSp(long long l,long long r){
  71. return readInt(l,r,' ');
  72. }
  73. long long readIntLn(long long l,long long r){
  74. return readInt(l,r,'\n');
  75. }
  76. string readStringLn(int l,int r){
  77. return readString(l,r,'\n');
  78. }
  79. string readStringSp(int l,int r){
  80. return readString(l,r,' ');
  81. }
  82. void solve()
  83. {
  84. ll x,y;
  85. x=readInt(1,(ll)1e12,' ');
  86. y=readInt(1,(ll)1e12,'\n');
  87. ll l1,r1;
  88. if(x%2==0)
  89. {
  90. l1=x/2;
  91. r1=x/2;
  92. }
  93. else
  94. {
  95. l1=x/2;
  96. r1=x/2+1;
  97. }
  98. for(ll l=1;l<=min((ll)1000000,y);l++)
  99. {
  100. if((y%l)!=0)
  101. continue;
  102. ll r=y/l;
  103. if(r<l)
  104. break;
  105. if(l>r1 || r<l1)
  106. {
  107. cout<<l1<<' '<<r1<<'\n';
  108. cout<<l<<' '<<r<<'\n';
  109. return;
  110. }
  111. }
  112. cout<<-1<<'\n';
  113. }
  114. int main()
  115. {
  116. #ifndef ONLINE_JUDGE
  117. freopen("input.txt", "r", stdin);
  118. freopen("output.txt", "w", stdout);
  119. #endif
  120. ios_base::sync_with_stdio(false);
  121. cin.tie(NULL),cout.tie(NULL);
  122. int T=readInt(1,10,'\n');
  123. while(T--)
  124. solve();
  125. assert(getchar()==-1);
  126. cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
  127. }