#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{

    long long t, i, j;
    cin >> t;
    long long a[t], b[t];
    for(i = 0; i < t; i++)
        cin >> a[i] >> b[i];
    for(i = 0; i < t; i++){
        if((a[i])%2 == 0 || (b[i])%2 != 0)
            cout << -1;
        else if(b[i] == a[i]-1)
            cout << a[i] << " "<< 1;
        else
            cout << -1;}
    return 0;
}