// NOTE: it is recommended to use this even if you don't understand the following code.
#include <fstream>
#include <iostream>
using namespace std;
void HaromJatszma(int A, int B){
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);
}
}
}
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
HaromJatszma(A,B);
}
else if(B < 11) cout << "-1 -1\n";///ha B nem nyert jatszmat nem lehetseges
else{
if(A - 33 > 10){///5 jatszma
if(B < 22) cout << "-1 -1\n";
else {
cout << "10 11\n";
A = A - 10; B = B - 11;
cout << A - 33 << " 11\n";
A = 33; B = B - 11;
HaromJatszma(A, B);
}
}
else{///4 jatszma
cout << A - 33 << " 11\n";
A = 33; B = B - 11;
HaromJatszma(A, B);
}
}
}
return 0;
}