Go: package main

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

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]
		var mulA, mulD int
		if a < 0 {
			mulA = a * -1
		} else {
			mulA = a
		}
		if d < 0 {
			mulD = d * -1
		} else {
			mulD = d
		}
		a *= mulD
		b *= mulD
		c *= mulD
		d *= mulA
		e *= mulA
		f *= mulA

		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.Print(x)
		fmt.Println(".000")
		fmt.Print(y)
		fmt.Println(".000")
	}
}

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

int main(int argc, char const *argv[]) {
  double x, y;
  double a, b, c, d, e, f;
  while (!(cin >> a >> b >> c >> d >> e >> f).eof()) {
    x = (f * c - b * d) / (a * f - b * e);
    y = (a * d - c * e) / (a * f - b * e);
    std::cout << fixed << setprecision(3) << x << " " << y << '\n';
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int a,b,c,d,e,f;
while (cin>>a>>b>>c>>d>>e>>f) {
 double Dx = c*e-b*f;
 double Dy = a*f-c*d;
 double D  = a*e-b*d;
 cout << fixed << setprecision(3) << Dx/D << ' ' << Dy/D << endl;
 }
return 0;
}

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

struct vector2{
	float x, y;
	vector2() : x(0), y(0){}
	vector2(float x, float y) : x(x), y(y){}
};

struct sim_elem{
	float a, b, c, d, e, f;
	sim_elem() :a(0), b(0), c(0), d(0), e(0), f(0){}
	sim_elem(float a, float b, float c, float d, float e, float f) :a(0), b(0), c(0), d(0), e(0), f(0){}
};

//	a / d * d
//	ey - by = f - c
//	y / y = (f - c) / y

// ax = -by + c
// ax / a = -(by + c) / a

vector2 sim_equ(sim_elem elem){

	float dx = elem.a / elem.d * elem.d;
	float ey = elem.a / elem.d * elem.e;
	float f = elem.a / elem.d * elem.f;

	float y = ey - elem.b;
	float yr = f - elem.c;
	y = yr / y;

	float ax = -elem.b * y + elem.c;
	float x = ax / elem.a;

	return vector2(x, y);
}

//	sprintf
float placement4(float val){
	char ret[128];
	sprintf(ret, "%.3f", val);
	return (float)atof(ret);
}

int main(){

	sim_elem elem;
	while (cin >> elem.a >> elem.b >> elem.c >> elem.d >> elem.e >> elem.f){

		vector2 ret;
		ret = sim_equ(elem);
		printf("%.3f %.3f\n", placement4(ret.x) ,placement4(ret.y) );
	}

	return 0;
}

C++: #include <stdio.h>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	double x, y;
	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
		int a1 = a, b1 = b, c1 = c, d1 = d, e1 = e, f1 = f;
		a1 *= e;
		b1 *= e;
		c1 *= e;
		d1 *= b;
		e1 *= b;
		f1 *= b;
		if(f1 - c1 == 0) printf("0.000 ");
		else printf("%.3f ", (double) (f1 - c1) / (d1 - a1));

		b *= d;
		c *= d;
		d *= a;
		e *= a;
		f *= a;
		if(f - c == 0) printf("0.000\n");
		printf("%.3f\n", (double) (f - c) / (e - b));
	}
	return 0;
}

C++: #include <cstdio>

int main(){
	int a,b,c,d,e,f;
	double x,y;
	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		x = (double)(e*c-b*f)/(e*a-b*d);
		y = (double) (a*(e*c-b*f)/(e*a-b*d)-c)/b;
		printf("%f %f\n",x,y);
	}
	return 0;
}

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

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

C++: #include<iostream>
#include<cmath>
 
using namespace std;
 
double round(double source, int precision) {    // ?????¨?????\
    return floor((fabs(source) * pow(10, (double)precision) + 0.5)) / pow(10, (double)precision) * (source < 0 ? -1 : 1);
}
 
int main() {
    double a, b, c, d, e, f, 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);
 
        cout.precision(3);
        cout << fixed << round(x, 3) << " " << round(y, 3) << endl;
        //cout << fixed << x + 1e-10 << " " << y + 1e-10 << endl;
    }
 
    return 0;
}

C++: #include<stdio.h>
int main()
{
    float a,b,c,d,e,f,x,y;
    while(scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)!=EOF)
    {
        x=(c*e-b*f)/(a*e-b*d);
        y=(c*d-a*f)/(b*d-a*e);
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

C++: #include<iostream>
int GCM(int a,int b){
	if(b==0)return a;
	return GCM(b,a%b);
}

int main(){
	int a,b,c,d,e,f;
	std::cout.precision(3);
	std::cout.setf(std::ios::fixed);
	while(std::cin>>a>>b>>c>>d>>e>>f){
		float x=0.000f,y=0.000f;
		int a_=a,b_=b,c_=c,d_=d,e_=e,f_=f;
		b_*=d,c_*=d;
		e_*=a,f_*=a;
		y=(c_-f_)/(b_-e_);
		x=(c-y*b)/a;
		std::cout<<x<<" "<<y<<std::endl;
	}
	return 0;
}

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


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

	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	double a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		double x = (c*d - a*f) / (b*d - a*e);
        double ans1 = (1000*((c - b*x) / a))/1000;
        double ans2 = (1000*x)/1000;
		cout << fixed << setprecision(3) << ans1 << " " << ans2 << endl;
	}
	return 0;
}

C++: # include <algorithm>
# include <cassert>
# include <cctype>
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cmath>
# include <iostream>
# include <map>
# include <queue>
# include <set>
# include <sstream>
# include <stack>
# include <string>
# include <vector>
# include <iomanip>

# define rep(i, n) for (int i = 0; i < (int)(n); i++)
# define irep(i, n) for (int i = int(n) - 1; i >= 0; i--)
# define FOR(i, m, n) for (int i = int(m); i < (int)(n); i++)

using namespace std;
typedef long long ll;


// %% begin matrix %%

typedef vector<double> vec;
typedef vector<vec> mat;

void pretty_print(mat g) {
  rep (i, g.size()) {
    rep (j, g[0].size()-1) {
      cout << g[i][j] << ' ';
    }
    cout << g[i][g[0].size()-1] << endl;
  }
}


mat mul(mat A, mat B) {
  mat C(A.size(), vec(B.size()));
  rep (i, A.size()) {
    rep (k, B.size()) {
      rep (j, B[0].size()) {
        C[i][j] += A[i][k] * B[k][j];
      }
    }
  }
  return C;
}

// %% end matrix %%


vec jordan(mat &A, vec &b) {
  int n = A.size();

  // ?????§?????°??????
  mat B(n, vec(n+1));
  rep (i, n) {
    rep (j, n) {
      B[i][j] = A[i][j];
    }
    B[i][n] = b[i];
  }


  rep (i, n) {
    int pivot = i;

    // ?????????
    for (int j = i; j < n; j++) {
      if (abs(B[j][i]) > abs(B[pivot][i])) {
        pivot = j;
      }
    }
    swap(B[i], B[pivot]);

    if (abs(B[i][i]) < 0.0000001) {
      return vec();
    }

    for (int j = i+1; j <= n; j++) B[i][j] /= B[i][i];
    rep (j, n) {
      if (i != j) {
        for (int k = i+1; k <= n; k++) {
          B[j][k] -= B[j][i] * B[i][k];
        }
      }
    }
  }

  vec x(n);
  rep (i, n) {
    x[i] = B[i][n];
  }

  return x;
}




int main() {

  rep (iter, 2) {

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

    mat A = {
      {a, b},
      {d, e}
    };

    vec B = {
      c, f
    };

    vec x = jordan(A, B);
    cout << x[0] << " " << x[1] << endl;
  } 
}