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
		y := cF / bE
		x := (c - (y * b)) / a

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

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

int main(){
	double a, b, c, d, e, f;
	while( cin >> a >> b >> c >> d >> e >> f )
		cout << fixed << std::setprecision(3) << (c*e - b*f)/(a*e - b*d) << " " << (c*d - a*f)/(b*d-a*e) << "\n";

	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))

//repetition//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int main(){
	double a,b,c,d,e,f;
	while(!cin.eof()){
		cin>>a>>b>>c>>d>>e>>f;
		printf("%.3f %.3f\n", (c*e-b*f)/(a*e-b*d), (c*d-a*f)/(b*d-a*e));
	}
	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(a == 0){
		y = c / b;
		x = (f-e*y) / d;
	}else{
		int A = a;
		a *= d;
		b *= d;
		c *= d;
		d *= A;
		e *= A;
		f *= A;
		y = (c-f) / (b-e);
		x = (c-b*y) / a;
	}
	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<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

const double EPS = 1E-8;
typedef vector<double> vec;
typedef vector<vec> mat;

vec gauss_jordan(const mat& A, const vec& b) {
    int n = (int)A.size();
    mat B(n, vec(n + 1));
    // init
    rep(i ,n) rep(j, n) B[i][j] = A[i][j];
    rep(i, n) B[i][n] = b[i];
    
    rep(i, n) {
        // 注目している変数の係数の絶対値が大きい式をi番目に持ってくる
        int pivot = i; // 要点
        rep3(j, i, n) if (abs(B[j][i]) > abs(B[pivot][i])) pivot = j;
        swap(B[i], B[pivot]);
        // 解がないか一意でない
        if (abs(B[i][i]) < EPS) return vec();
        // 注目している変数の係数を1にする
        rep3(j, i + 1, n + 1) B[i][j] /= B[i][i];
        // j番目の式からi番目の変数を消去
        rep(j, n) if (i != j) rep3(k, i + 1, n + 1) B[j][k] -= B[j][i] * B[i][k];
    }
    
    vec x(n);
    rep(i, n) x[i] = B[i][n];
    return x;
}

int main() {
    int a, bb, c, d, e, f;
    while (cin >> a >> bb >> c >> d >> e >> f) {
        mat A(2, vec(2));
        vec b(2);
        A[0][0] = a; A[0][1] = bb;
        A[1][0] = d; A[1][1] = e;
        b[0] = c;
        b[1] = f;
        auto v = gauss_jordan(A, b);
        cout << fixed << setprecision(3) << v[0] << " " << v[1] << '\n';
    }
    
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(3);
  double a, b, c, d, e, f, x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    x = (c * e - b * f) / (a * e - d * b);
    y = (a * f - c * d) / (a * e - b * d);
    if (!x) x = 0;
    if (!y) y = 0;
    cout << x << ' ' << y << '\n';
  }
  return 0;
}

C++: #include <algorithm>
#include <string.h>
#include <stdio.h>

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) / (double)(a * e - b * d);
		y = (double)(a * f - d * c) / (double)(a * e - b * d);
				printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include<stdio.h>

int main(void)
{
	double a,b,c,d,e,f;
	
	while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF)
	{
		printf("%.3f %.3f\n",(e*c-b*f)/(a*e-b*d)+0.0,(a*f-d*c)/(a*e-b*d)+0.0);
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>

using namespace std;

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

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5){
		a=a+10-int(a)%10;
	}else{
		a=a-int(a)%10;
	}
	
	a=double (int (a/10));
	a=a/10000;

}
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){
		y=(c*d-a*f)/(b*d-a*e);
		x=(c-b*y)/a;
		/*
		x=round3(x);
		y=round3(y);
		*/
		printf("%0.3lf %0.3lf\n",x,y);
	}
	return 0;
}

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

using namespace std;

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

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

C++: ///
// File:  0004.cpp
// Author: ymiyamoto
//
// Created on Wed Nov  8 21:45:53 2017
//

#include <cstdint>
#include <iomanip>
#include <iostream>

using namespace std;

int32_t main()
{
  while (true) {
    double a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    if (cin.eof()) break;

    double x = (e * c - b * f) / (a * e - b * d);
    double y = (a * f - d * c) / (a * e - b * d);
    cout << fixed;
    cout << setprecision(3) << x << " " << y << endl;
  }

  return 0;
}