#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, k;
  cin >> n >> k;
  if (k % n == 0) {
    cout << n << " " << k;
    return;
  }
  if (n * 2 < k) {
    cout << n << " " << n * 2;
    return;
  } else {
    cout << "-1 -1";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int test;
  cin >> test;
  while (test--) {
    solve();
    cout << "\n";
  }
}
