1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. assert(t <= 10);
  8. while(t--) {
  9. long long int x, y;
  10. cin >> x >> y;
  11. bool found = 0;
  12. for(long long int i = 1; i*i <= y; i++) {
  13. if(y%i == 0) {
  14. if(y/i < x/2 || i > (x + 1)/2) {
  15. cout << x/2 << " " << (x + 1)/2 << "\n";
  16. cout << i << " " << y/i << "\n";
  17. found = 1;
  18. break;
  19. }
  20. }
  21. }
  22. if(!found) cout << "-1\n";
  23. }
  24. }