#include <bits/stdc++.h>
using namespace std;
const double PI = atan(1) * 4;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
vector<vector<int>> ar(1000009);
vector<int> vis(1000009, 0), dis(1000009, 0), pre(1000009, -1);
void bfs(int u, int v) {
  queue<int> q;
  q.push(u);
  vis[u] = 1;
  dis[u] = 0;
  while (!q.empty()) {
    int curr = q.front();
    q.pop();
    for (int child : ar[curr]) {
      if (vis[child] == 0) {
        q.push(child);
        dis[child] = dis[curr] + 1;
        vis[child] = 1;
        pre[child] = curr;
      }
    }
  }
}
bool isprime(int n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
bool comp(pair<int, int> a, pair<int, int> b) { return b.first < a.first; }
int modpow(int b, int p, int m) {
  if (p == 0) return 1 % m;
  if (p % 2) return (b * modpow(b, p - 1, m)) % m;
  int u = modpow(b, p / 2, m);
  return (u * u) % m;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    if (b < 2 * a)
      cout << -1 << " " << -1 << "\n";
    else {
      cout << b / 2 << " ";
      if (b % 2)
        cout << b - 1 << "\n";
      else
        cout << b << "\n";
    }
  }
  return 0;
}
