// NOTE: it is recommended to use this even if you don't understand the following code.
#include <fstream>
#include <iostream>
using namespace std;
int main() {
// uncomment the following lines if you want to read/write from files
// ifstream cin("input.txt");
// ofstream cout("output.txt");
int T;
cin >> T;
while (T--) {
int A, B;
cin >> A >> B;
if(A < 33 or B > 52) cout << "-1 -1\n";
else if(A == 33){///3 jatszma
if(B > 30) cout << "-1 -1\n";
else{
while(A > 0){
cout << 11 << " " << min(10, B) << "\n";
A = A - 11; B = B - min(10, B);
}
}
}
}
return 0;
}