#include<iostream>
using namespace std;
int main(){
int n,a,b,c,d,e,f,g,h,b1,c1,e1,f1,x,y;
cin>>n;
for(int i=1;i<=n;i=i+1){
while(cin>>a>>b>>c>>d>>e>>f){
if((a/d)!=(b/e)){
b1=b*d;
c1=c*d;
e1=e*a;
f1=f*a;
g=b1-e1;
h=c1-f1;
y=h/g;
x=(c-y*b)/a;
cout<<x<<" "<<y<<endl;
cout<<b1<<c1<<e1<<f1;
}
}
}
}
#include
using namespace std;
int main(){
int n,a,b,c,d,e,f,g,h,b1,c1,e1,f1,x,y;
cin>>n;
for(int i=1;i<=n;i=i+1){
while(cin>>a>>b>>c>>d>>e>>f){
if((a/d)!=(b/e)){
b1=b*d;
c1=c*d;
e1=e*a;
f1=f*a;
g=b1-e1;
h=c1-f1;
y=h/g;
x=(c-y*b)/a;
cout<<x<<" "<<y<<endl;
cout<<b1<<c1<<e1<<f1;
}
}
}
}
如果a=0
0就在分母了