Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	for sc.Scan() {
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.ParseFloat(s[0], 64)
		b, _ := strconv.ParseFloat(s[1], 64)
		c, _ := strconv.ParseFloat(s[2], 64)
		d, _ := strconv.ParseFloat(s[3], 64)
		e, _ := strconv.ParseFloat(s[4], 64)
		f, _ := strconv.ParseFloat(s[5], 64)
		x := ((b * f) - (c * e)) / ((b * d) - (a * e))
		y := ((a * f) - (c * d)) / ((a * e) - (b * d))
		if x == 0 {
			fmt.Printf("0.000 %.3f\n", y)
		} else if y == 0 {
			fmt.Printf("%.3f 0.000\n", x)
		} else {
			fmt.Printf("%.3f %.3f\n", x, y)
		}
	}
}

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

using namespace std;

using DataSet = vector<double>;

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

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){
    for(int i = 0; i < data_set.size(); ++i){
        vector<double> buff;

        double det = determinant2d(data_set[i]);

        inverse2d(data_set[i]);

        calculateXY(data_set[i], det, buff);

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



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

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

    solve(data_set);
}


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

C++: #include <bits/stdc++.h>
using namespace std;

int main(void){
	float equ[2][3];
	while(cin){
		for(int i=0;i<2;i++)
			for(int j=0;j<3;j++)
				cin >> equ[i][j];
		float delta = -equ[0][0]*equ[1][1]+equ[0][1]

*equ[1][0];
		float y = (-equ[0][0]*equ[1][2]+equ[0][2]*equ

[1][0])/delta;
		float x = (equ[0][2]-equ[0][1]*y)/equ[0][0];
		printf("%.3f %.3f\n",x,y);
	}
}

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

using namespace std;

int main() {
	double a, b, c, d, e, f;
	while (cin>>a>>b>>c>>d>>e>>f) {
		double mat = a * e - b * d;
		double dx = c * e - b * f;
		double dy = a * f - d * c;

		printf("%.3f %.3f\n", dx/mat, dy/mat);
	}
	return 0;
}

C++: /*
	ax+by=c, dx+ey=fのx,y 
	x=(E1*B2-B1*E2)/(A1*B2-B1*A2)
	y=(E2*A1-E1*A2)/(A1*B2-A2*B1)
*/

#include<iostream>
#include <iomanip>
using namespace std;

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

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 = ( c * d  - a * f ) / ( b * d - a * e );
		if ( a ){
			x = ( c - b * y ) / a;
		}else{
			x = ( f - e * y ) / d;
		}

		cout << showpoint << setprecision(3);
		cout << setiosflags( ios::fixed );
		cout << ( x == -0.0 ? 0.0 : x ) << " " << ( y == -0.0 ? 0.0 : y ) << endl;

	}
}

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

int main(){
	float x, y;
	int a, b, c, d, e, f, xx, yy;
	string p, q;
	while (true){
		cin >> a >> b >> c >> d >> e >> f;
		if (cin.eof()){
			break;
		}
		if (a == 0){
			y = c / b;
			x = (f - e * y) / d;
		}
		else if (b == 0){
			x = c / a;
			y = (f - d * x) / e;
		}
		else if(d == 0){
			y = f / e;
			x = (c - b * y) / a;
		}
		else if(e==0){
			x = f / d;
			y = (c - a * x) / b;
		}
		else{
			x = (c*e - b*f) / (e*a - b*d);
			y = (c - a*x) / b;
		}
		xx = x / 1;
		yy = y / 1;
		p = to_string(xx);
		q = to_string(yy);
		p += ".";
		q += ".";
		b = x * 10;
		c = y * 10;
		for (int i = 1;i<4;i++){
			p += to_string((b*10) % 10);
			q += to_string((c*10) % 10);
			x = x * 10;
			y = y * 10;
			b = x;
			c = y;
		}
		cout << p << " " << q << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i,N) for(int i = 0; i < (int)N; i++)

double det(double a1,double a2,double a3,double a4){
	return a1*a4-a2*a3;
}

int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double g,h,i;
		g = det(a,b,d,e);
		h = det(c,b,f,e);
		i = det(a,c,d,f);
		double j,k;
		j = h/g;
		k = i/g;
		j = round(j*pow(10,4))/pow(10,4);
		k = round(k*pow(10,4))/pow(10,4);
		printf("%.3f %.3f",j,k);
	}
	return 0;
}

C++: #include <cstdio>
#include <vector>
#include <cmath>
#include <iostream>

using namespace std;

int main(){
  double a,b,c,d,e,f;
  vector<double> out;
  while (cin>>a>>b>>c>>d>>e>>f){
    out.push_back((c*e-b*f)/(a*e-b*d));
    out.push_back((c*d-a*f)/(b*d-a*e));
  }
  for (int i=0;i<out.size();i+=2){
    printf("%.3f %.3f\n",round(out[i]*1000)/1000.0,round(out[i+1]*1000)/1000.0);
  }
  return 0;
}

C++: #include <iostream>
#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-(b*y))/a;
		cout<<setiosflags(ios::showpoint)<<setprecision(4)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
#include <vector>
using namespace std;

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

C++: 
/*
 * main.cpp
 *
 *  Created on: 2011/04/01
 *      Author: satoki
 *      22:08 ~ 04/09 10:51
 *      »ê¼êÆ§Åððo·
 */
#include <iostream>
#include <string.h>
using namespace std;

double dA;
double dB;
double dC;
double dD;
double dE;
double dF;

double dX;
double dY;

bool input() {
  if (scanf("%lf %lf %lf %lf %lf %lf", &dA, &dB, &dC, &dD, &dE, &dF) == EOF) return false;
  return true;
}

void manage() {
  int tmp;

  dX = (dC * dE - dB * dF) / (dA * dE - dB * dD);
  dY = (dC * dD - dA * dF) / (dB * dD - dA * dE);

  tmp = (int)dX;
  dX -= tmp;
  dX = (int)(dX * 1000 + 0.5 - (dX < 0)) / (double)1000;
  dX += tmp;
  tmp = (int)dY;
  dY -= tmp;
  dY = (int)(dY * 1000 + 0.5 - (dY < 0)) / (double)1000;
  dY += tmp;
}

int main() {
  while (1) {
    if (!input()) break;
    manage();
    printf("%.3f %.3f\n", dX, dY);
  }
}

C++: #include <iostream>
#include <stdio.h>
#define swap(a,b) {a=a+b; b=a-b; a=a-b;}
using namespace std;

void q4() {
	double a, b, c, d, e, f;
	for (;;) {
		cin >> a >> b >> c >> d >> e >> f;
		//scanf_s("%lf %lf %lf %lf %lf %lf\n", &a, &b, &c, &d, &e, &f);

		if (a == 0) {
			swap(a, d);
			swap(b, e);
			swap(c, f);
		}
		b /= a;
		c /= a;
		a = 1;

		e -= b * d;
		f -= c * d;
		d = 0;

		f = f / e;
		e = 1;
		
		c -= f * b;
		b = 0;

		printf("%4lf %4lf\n", c, f);
	}
}

int main() {
	q4();
	return 0;
}