Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func gcd(num1, num2 int) int {
	if num2 == 0 {
		return num1
	}
	num3 := num1 % num2
	return gcd(num2, num3)
}

func lcm(num1, num2 int) int {
	if num1%num2 != 0 {
		num3 := gcd(num1, num2)
		for i := 1; ; i++ {
			check := num3 * i
			if check%num1 == 0 && check%num2 == 0 {
				return check
			}
		}
	} else {
		return num1
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for scanner.Scan() {
		strNums := strings.Fields(scanner.Text())
		nums := []int{}
		for _, strNum := range strNums {
			num, _ := strconv.Atoi(strNum)
			nums = append(nums, num)
		}
		a := nums[0]
		b := nums[1]
		c := nums[2]
		d := nums[3]
		e := nums[4]
		f := nums[5]
		lcm := lcm(a, d)
		mulA := lcm / a
		mulD := lcm / d
		a *= mulA
		b *= mulA
		c *= mulA
		d *= mulD
		e *= mulD
		f *= mulD

		if d < 0 {
			d *= -1
			e *= -1
			f *= -1
		}

		bE := b - e
		cF := c - f
		if bE==0{
		    bE=1
		}
		y := cF / bE
		x := (c - (y * b)) / a

		
			fmt.Printf("%d.000 ", x)
			fmt.Printf("%d.000\n", y)
	}
}

C++: #include <iostream>

using namespace std;

int main() {
	double a, b, c, d, e, f, x, y, t;
	while(cin >> a >> b >> c >> d >> e >> f) {
		t = 1.0 / (a*e - b*d);
		x = (e*c - b*f) * t;
		y = (a*f - d*c) * t;
		cout << x << setprecision(3) << y << setprecision(3) << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;

int main(void){
    double a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        y=(a*f-d*c)/(a*e-b*d);
        x=(e-b*y)/a;
        printf("%.3lf %.3lf\n", x, y);
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;

void OutputSolution(int a, int b, int c, int d, int e, int f)
{
    double x, y;
	if(b == 0){
		x = c / a;
		y = (f-d*x) / e;
	}else{
		int B = b;
		a *= e;
		b *= e;
		c *= e;
		d *= B;
		e *= B;
		f *= B;
		x = (c-f) / (a-d);
		y = (c-a*x) / b;
	}
	if(x == -0) x = 0;
	if(y == -0) y = 0;
	cout << fixed << setprecision(3) << x << ' ' << y << endl;
}

int main()
{
	while(true){
		int a, b, c, d, e, f;
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;
		OutputSolution(a, b, c, d, e, f);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void){

	double a, b, c, d, e, f;
	double A,B;
	double x, y;

	while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f) != EOF){
		 
	 
	 if ( (a >= 0 && d < =0)|| (a >= 0 && d >= 0)) {
		A = c*d - f*a;
		B = b*d - e*a;
        y = A / B;
    }
    
    else if ((a < 0 && d > 0) || (a < 0 && d < 0)) {
		A = c*d + f*a;
		B = b*d + e*a;
        y = A / B;
    }


    x = (c - y * b) / a;
	printf("%.3f %.3f\n" ,x , y);
	}
	return 0;

}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
    double a,b,c,d,e,f;
    double x,y;
    while (cin >> a >> b >> c >> d >> e >> f) {
            
        x=(c*e-b*f)/(a*e-b*d);
       
        y=(a*f-c*d)/(a*e-b*d);
        printf("%.3f %.3f\n",x,y);
    }
}

C++: #include <iostream>
#include <stdio.h>
#include <iomanip>

using namespace std;

int main(){
    double a,b,c,d,e,f;
    double x,y;
    while(cin>>a>>b>>c>>d>>e>>f) {
        y = (c*d - a*f)/(b*d - a*e);
        x = (c*e - f*b)/(a*e - b*d);
        if(x == 0) {x = 0;}
        if(y == 0) {y = 0;}
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>


int main () {
  int a, b, c, d, e, f;
  float x, y, temp;
  std::cout << (std::fixed) << std::setprecision(3);
  while (std::cin >> a >> b >> c >> d >> e >>f) {
    y = (c * d - f * a) / (float)(b * d - e * a);
    x = (c - b * y) / (float)a;
    std::cout << x << " " << y << std::endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	float a,b,c,d,e,f,x,y;
	while(cin>>a>>b>>c>>d>>e>>f){
		y = (d*c - a*f)/(d*b - a*e);
		x = (f - e*y)/d;
	printf("%0.3f %0.3f \n",x+0.00000001,y+0.00000001);
	}
}

C++: #include <iostream>
#include <iomanip>
using namespace std;

int main(){
    
    double a,b,c,d,e,f,x,y;
    
    while(cin>>a>>b>>c>>d>>e>>f){
        
        y=((d/a)*c-f)/((d/a)*b-e);
        x=((e/b)*c-f)/((e/b)*a-d);
        
        cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
    }
}

C++: #include<iostream>
#include<stdio.h>
using namespace std ;

int main(){
	
	double a,b,c,d,e,f ;
	double x,y ;
	
	while(1){
		cin >> a ;
		if( cin.eof() ) break ;
		cin >> b >> c ;
		cin >> d >> e >> f ;
		
		if( a*e - b*d == 0 ){
			cout << "error" << endl ;
		}
		else{
			x = ( c*e - b*f ) / ( a*e - b*d ) ;
			y = ( c*e - b*f ) / ( a*e - b*d ) ;
		}
		
		printf("%.3lf %.3lf\n",x ,y) ;
	}
	
return 0 ;
}

C++: #include <stdio.h>
#include <iostream>
using namespace std;

int main(void)
{
	double a,b,c,d,e,f;
	double ans[2];

	cin >> a >> b >> c >> d >> e >> f;

	ans[1] = (c*d-a*f)/(b*d-a*e);
	ans[0] = (c*d-b*d*ans[1])/(a*d);

	printf("%.3lf %.3lf\n", ans[0]+0.005,ans[1]+0.005);

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <sstream>

using namespace std;

using DataSet = vector<double>;

//void debug(const string& prefix, const DataSet& data);

void readInputData(vector<string>& input_data){
    string buff;
    while(getline(cin, buff)){
        input_data.push_back(buff);
    }
    cout << input_data.size() << endl;
}

void _parseString(const string& input_data, DataSet& data_set) {
    data_set.resize(6);

    stringstream ss;
    ss << input_data;
    ss >> data_set[0] >> data_set[1] >> data_set[2]
        >> data_set[3] >> data_set[4] >> data_set[5];
}

void parseString(const vector<string>& input_data, vector<DataSet>& data_set) {
    data_set.resize(input_data.size());
    for(int i = 0; i < input_data.size(); ++i) {
        DataSet buff;
        _parseString(input_data[i], buff);
        data_set[i] = buff;
    }
}

double determinant2d(const DataSet& data){
    return data[0] * data[4] - data[1] * data[3];
}

void inverse2d(DataSet& data){
    double t = data[0];
    data[0] = data[4];
    data[4] = t;

    data[1] = -data[1];
    data[3] = -data[3];
}


void calculateXY(const DataSet& data, double det, vector<double>& result){
    result.resize(2);

    result[0] = (data[0] * data[2] + data[1] * data[5]) / det;
    result[1] = (data[3] * data[2] + data[4] * data[5]) / det;
}

void solve(vector<DataSet>& data_set){
    cout << fixed;
    cout << setprecision(3);

    for(int i = 0; i < data_set.size(); ++i){
        vector<double> buff;

        double det = determinant2d(data_set[i]);

        inverse2d(data_set[i]);
        //debug("inverse", data_set[i]);

        calculateXY(data_set[i], det, buff);
        //debug("calculate", data_set[i]);

        cout << buff[0] << " " << buff[1] << endl;
    }
}

//void debug(const string& prefix, const DataSet& data){
//
//
//    cout << prefix << endl;
//
//    cout << "Matrix:" << endl;
//    cout << data[0] << "  " << data[1] << endl;
//    cout << data[3] << "  " << data[4] << endl;
//
//    cout << "\nx_y:\n";
//    cout << data[2] << "\n" << data[5] << "\n";
//
//    cout << "\ndet: " << determinant2d(data) << endl;
//}



void doAllProcess(){
    vector<string> input_data;
    readInputData(input_data);

    vector<DataSet> data_set;
    parseString(input_data, data_set);

    solve(data_set);
}

//
//void test(){
//    vector<string> input_data;
//    input_data.push_back("1 2 3 4 5 6");
//    input_data.push_back("2 -1 -2 -1 -1 -5");
//    input_data.push_back("2 -1 -3 1 -1 -3");
//    input_data.push_back("2 -1 -3 -9 9 27");
//
//    vector<DataSet> data_set;
//    parseString(input_data, data_set);
//
//    solve(data_set);
//
//    getchar();
//}

int main(){
    doAllProcess();
    //test();
    return 0;
}