#include<iostream>
#include<iomanip>
#include<cstdio>

using namespace std;

int main(){

  int i;
  float a, b, c, d, e, f;
  float temp;
  float x, y;

  cout << "datasets: ";
  cin >> i;
  for(int j=0; j<i; j++){
    cin >> a >> b >> c >> d >> e >> f;

    temp = a/d;
    d = d*temp;
    e = e*temp;
    f = f*temp;
    b = b-e;
    c = c-f;
    y = c/b;
    x = (f-e*y)/d;

    cout << fixed << setprecision(3) << x << " " << y << "\n";
  }
  return 0;
}