import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.file;
  
void main() {
	string l;
	readln();
	while((l = readln()).length >= 2)
	{
		int a, b, c, d, e, f;
		a = to!int(l.split()[0]), b = to!int(l.split()[1]), c = to!int(l.split()[2]);
		d = to!int(l.split()[3]), e = to!int(l.split()[4]), f = to!int(l.split()[5]);
		double x, y;
		y = (c/a - f/d) / (b/a - e/d);
		x = (c/d - b/a) * y;
		x = to!double(to!int(x * 1000)) / 1000;
		y = to!double(to!int(y * 1000)) / 1000;
		writeln(x," ",y);
	}
}