#include <iostream> //üoÍ
#include <vector>   //®Izñ
#include <cstdio>
#include <cmath>

using namespace std;

int main(){
	double n;
	while(cin >> n){
		vector<double> vec;
		vec.push_back(n);
		for(int i=0;i<5;i++){
			cin >> n;
			vec.push_back(n);
		}
		double x = ((vec[2]*vec[4])-(vec[1]*vec[5]))/((vec[0]*vec[4])-(vec[1]*vec[3]));
		double y = (vec[2]-(vec[0]*x))/vec[1];

		x = floor((x*1000)+0.5)/1000;
		y = floor((y*1000)+0.5)/1000;
		printf("%.3f %.3f\n", x, y);
		
	}
	
		return 0;
}