/*****include*****/
#include <iostream>
#include <fstream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return;
	}
#endif
	/*****変数置き場*****/
	double a1,b1,c1,a2,b2,c2;
	/*****処理部*****/
	while(1){
		cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
		b1 = b1 / a1;
		c1 = c1 / a1;
		a1 = 1;
		b2 = b2 / a2;
		c2 = c2 / a2;
		a2 = 1;
		b2 = b2 - b1;
		c2 = c2 - c1;
		a2 = 0;
		a1 = a1 / b1;
		c1 = c1 / b1;
		c2 = c2 / b2;
		c1 = c1 - c2;
		c1 = c1 / a1;
		if(c1 == 0)	c1 = 0;
		if(c2 == 0)	c2 = 0;
		printf("%.3f %.3f\n",c1,c2);
	}
	//cout << set.w(5) << c1 << " " << c2 << endl;

	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}