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

		if x == 0 {
			fmt.Printf("%.3f ", 0.0)
		} else {
			fmt.Printf("%.3f ", x)
		}
		if y == 0 {
			fmt.Printf("%.3f\n", 0.0)
		} else {
			fmt.Printf("%.3f\n", y)
		}
	}
}

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

void SolveAndShowEquation(double a,double b,double c,double d,double e,double f);
double Roundoff(double x);
int main(){
  double a,b,c,d,e,f;
  while(cin>>a>>b>>c>>d>>e>>f){
    SolveAndShowEquation(a,b,c,d,e,f);
  }
  return 0;
}

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

double Roundoff(double x){
  if( x<0 ){
    x*=-1;
    x=double(int(x*1000))/1000+((((x*1000)-int(x*1000))*10)>=5?0.001:0);
    x*=-1;
  }else{
    x=double(int(x*1000))/1000+((((x*1000)-int(x*1000))*10)>=5?0.001:0);
  }
  return x;
}

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

C++: #include <iostream>
#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 = (double)(c*e-b*f) / (a*e-b*d);
    y = (double)(f-d*x) / e;

    printf("%.3f %.3f\n", x, y);

  }


  return 0;
}

C++: #include<stdio.h>

int main(void){
  double a,b,c,d,e,f;
  double x,y;
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF){
    if(a*e == b*d){
      printf("This equiation has no real number solution");
      break;
    }
    x = (e * c + (-1)*b*f)/(a*e-b*d);
    y = ((-1)*d*c + a * f)/(a * e - b* d);
    printf("%f %f\n",x,y);
  }
  return 0;
}

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

int main() {
	double a, b, c, d, e, f, x, y;

	while (1) {
		cin>>a>>b>>c>>d>>e>>f;
		if (cin.eof()) break;

		x = (c * d - a * f) / (b * d - e * a);
		y = (c - (b * y)) / a;

		cout<<setiosflags(ios::fixed)<<x<<" "<<y<<endl;
	}

	return 0;
}

C++: #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){
        x = (b*f-c*e)/(b*d-a*e);
        y = (a*f-c*d)/(a*e-b*d);
        cout<<fixed<<setprecision(3)<<x<<' '<<y<<endl;
    }
    return 0;
}

C++: #include <stdio.h>

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

C++: #include <iostream>
#include <math.h>
using namespace std;
int main() {
	long double a, b, c, d, e, f, x, y;
	while (cin >> a >> b >> c >> d >> e >> f) {
		x = (long double)(b*f - e * c) / (d*b - a * e);
		y = (long double)(a*f - d * c) / (a*e - d * b);
		if (x < 0)
			x = (long double)((int)(x * 1000 - 0.5)) / 1000;
		else
			x = (long double)((int)(x * 1000 + 0.5)) / 1000;
		if (y < 0)
			y = (long double)((int)(y * 1000 - 0.5)) / 1000;
		else
			y = (long double)((int)(y * 1000 + 0.5)) / 1000;
		printf("%.3llf %.3llf\n", x, y);
	}
	return 0;
}

C++: #include <stdio.h>
float round3(float a){
	a=a*10000;
	if(int(a)%10>5)a+10;
	a=double (int (a));
	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){
		if(a*e==b*d){
		}else if(b*d==a*e){
		}else{
			x=(c*e-b*f)/(a*e-b*d);
			y=(c*d-a*f)/(b*d-a*e);
		}
		
		
		x=round3(x);
		y=round3(y);
		printf("%.3f %.3f\n",x,y);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#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=(a*f-c*d)/(a*e-d*b);
		x=(c-b*y)/a;
		cout<<fixed<<setprecision(3)<<x<<" "<<y<<endl;
	}
	return 0;
}

C++: #include<stdio.h>

int main(void){
	double x=0,y=0;
	double a=0,b=0,c=0,d=0,e=0,f=0,i=0,j;
    
    while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF)
	{
		y = ( c * d - a * f ) / ( b * d - e * a );

        x = ( c - ( b * y ) ) / a;

		printf("%.3lf %.3lf\n",x,y);
	}
  return 0;
}

C++: #include <cstdio>

using namespace std;

int main()
{
  long long a, b, c, d, e, f;
  while(scanf("%lld%lld%lld%lld%lld%lld", &a, &b, &c, &d, &e, &f) != EOF){
    long long g = e * a;
    long long h = f * a;
    long long i = b * d;
    long long j = c * d;
    long long k = i - g;
    long long l = j - h;
    double y = (double)l / (double)k;
    double x = (double)(c - b*y) / (double)a;

    printf("%lf %lf\n", x, y);
  }
  return 0;
}

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

C++: const int tt = 10000;

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

string toStr(int n);
string intToString(int n);

int main() {
  int a, b, c, d, e, f;
  
  while(cin >> a >> b >> c >> d >> e >> f) {
    c = c * tt;
    f = f * tt;

    int det = a * e - b * d;

    int x = ( e * c - b * f) / det;
    int y = (-d * c + a * f) / det;
//    cout << x << y << endl;

    cout << toStr(x) << " " << toStr(y) << endl;
  }
}

string toStr(int n) {
  string pm, val;
  
  if (n < 0) {
    pm = "-";
    n = -n;
  } else {
    pm = "";
  }

  int ipart = n / tt;
  int fpart = (n - ipart * tt) + tt + 5;

  val = pm + intToString(ipart) + "." + intToString(fpart).substr(1, 3);
  return val;
}

string intToString(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}

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

using namespace std;

/*
aX+bY=c
dX+eY=f
*/

void solve(int a, int b, int c, int d, int e, int f) {
	double x = (f - (double)e*c/b) / (d - (double)e*a/b);
	double y = (double)(c - a*x) / b;
	printf("%4.3f %4.3f\n", x, y);
}

int main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f) {
		solve(a,b,c,d,e,f);
	}
	return 0;
}

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004&lang=jp
#include <algorithm>
#include <vector>
#include <iostream>
#include <math.h>
//#include <bits/stdc++.h>	//C++標準ライブラリ一括読み込み
using namespace std;

// ax+by=c
// dx+ey=f
double unko(double x){
	int y=int(round(x*1000));
	return double(y/1000);
}

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