Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	for {
		data := nextInts(6)
		fmt.Printf("%.3f\n", Round(GetX(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
		fmt.Printf("%.3f\n", Round(GetY(data[0], data[1], data[2], data[3], data[4], data[5]), 3))
	}
}

func GetX(a, b, c, d, e, f float64) float64 {
	return float64(((c * e) - (b * f)) / ((a * e) - (b * d)))
}

func GetY(a, b, c, d, e, f float64) float64 {
	return float64(((c * d) - (a * f)) / ((b * d) - (a * e)))
}

func Round(f float64, places int) float64 {
	shift := math.Pow(10, float64(places))
	return math.Floor(f*shift+.5) / shift
}

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

func nextInt() float64 {
	a, _ := strconv.Atoi(next())
	return float64(a)
}

func nextInts(n int) []float64 {
	a := make([]float64, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>

#define doubled( x ) (x * x)

//?????????????¨????(2 * 2??£?????????)
int matrix_val(int a11, int a12, int a21, int a22);

//?????°?????°?????? (in:??´??° out:?????°)
int digit_count(int num);

using namespace std;

int main()
{
	int a, b, c, d, e, f;
	
	cin >> a >> b >> c ;
	cin >> d >> e >> f;
	do
	{
		int A_matrix_val = matrix_val(a, b, d, e);
		int elem_x = matrix_val(c, b, f, e);
		int elem_y = matrix_val(a, c, d, f);
		double ans_x, ans_y;
		
		if( elem_x == 0 )ans_x = 0;
		else ans_x = (double)elem_x / A_matrix_val;
		
		if( elem_y == 0 )ans_y = 0;
		else ans_y = (double)elem_y / A_matrix_val;
		
		printf("%.3f %.3f\n", ans_x, ans_y);

	}while( (cin >> a >> b >> c >> d >> e >> f) );
	
	return 0;
}

int matrix_val(
int a11, int a12,
int a21, int a22
){
	return ((a11 * a22) - (a12 * a21));
}

int digit_count(int num)
{
	if( num < 0 )num *= (-1);
	
	int count = 0;
	
	for(int i = 10; num != 0; i *= 10)
	{
		int diff = num % i;
		num -= diff;
		count++;
	}
		
	return count;
}

C++: #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<iomanip>
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 = ((b * f) - (e * c)) / ((b * d) - (a * e));
		y = ((a * f) - (d * c)) / ((a * e) - (d * b));

		if(x == 0){
			x = 0;
		}
		if(y == 0){
			y = 0;
		}

		cout << fixed << setprecision(3) << x << " ";
		cout << fixed << setprecision(3) << y << endl;
	}

	return 0;
}

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

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

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  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){
    x=(c*e-b*f)/(a*e-b*d);
    if(x==-0){
      x=0;
    }
    y=(d*c-a*f)/(d*b-a*e);
    if(y==-0){
      y=0;
    }
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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

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

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
float a,b,c,d,e,f;
float findoutx,findouty;
float x,y,yadd;
float Timers1,Timers2;
int main()
{
    while((cin >> a >> b >> c >> d >> e >> f))
    {
    Timers1 = a;
    Timers2 = d;
    a=a*Timers2;
    b=b*Timers2;
    c=c*Timers2;
    d=d*Timers1;
    e=e*Timers1;
    f=f*Timers1;

    findouty=b-e;
    yadd = c-f;
    findouty = yadd/findouty;
    b = b*findouty;
    findoutx=(c-b)/a;

    if(findoutx==0)findoutx=0;
    if(findouty==0)findouty=0;



    cout<<fixed<<setprecision(3)<<findoutx << " " <<findouty<<endl;
    }

return 0;
}

C++: #include<iostream>
#include<cmath>
#include<iomanip>
double pow(double x,double y);
using namespace std;
int main(){
  double a,b,c,d,e,f,x,y,g,z,aa,bb;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    g=b;
    z=c;
    c*=d;
    b*=d;
    e*=a;
    f*=a;
    b-=e;
    c-=f;
    y=c/b;
    g*=y;
    z-=g;
    x=z/a;
    aa=round(x);
    bb=round(y);
    cout<<fixed;
    cout<<setprecision(3)<<aa<<' '<<setprecision(3)<<bb<<' '<<endl;
  }
  return(0);
}

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

int main(){
    float a, b, c, d, e, f, x, y, dividedNum1, dividedNum2 = 0;
    while(cin >> a >> b >> c >> d >> e >> f){
        dividedNum1 = a;
        dividedNum2 = d;
        a /= dividedNum1;
        b /=dividedNum1;
        c /= dividedNum1;
        d /= dividedNum2;
        e /= dividedNum2;
        f /= dividedNum2;
        
        float temp1 = b - e;
        float temp2 = c - f;
        
        y = floor(((temp2 / temp1) + 0.0005) * 1000) / 1000;
        x = floor((c - (b * y) + 0.0005)* 1000) / 1000;
        
        cout << fixed << setprecision(3) << x << " " << fixed << setprecision(3) << y << endl;
    }
    return 0;
}

C++: #include <iostream>

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int a,b,c,d,e,f;
    double x,y;
    while (std::cin >> a >> b >> c >> d >> e >> f) {
        int delta = (a * e) - (b * d);
        x = (e * c + -b * f) / (double) delta + 0;
        y = (-d * c + a * f) / (double) delta + 0;
        std::printf("%.3f %.3f\n", x, y);
    }
}

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

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

	return 0;
}

C++: #include <iostream>
#include <cstdio>	// require printf
//#include <fstream>	// require freopen

using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.se2", "r", stdin);
	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);
		if (x == -0. ){
			x = 0.;
		} // end if
		if (y == -0. ){
			y = 0.;
		} // end if
		
		printf ("%.3lf %.3lf\n", x, y );
	} // end loop
		
	return 0;
}

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

int get_gcd(int a, int b) {
    if (a % b == 0) return b;
    return get_gcd(b, a % b);
}

int main() {
    int a,b;
    while (cin>>a>>b) {
        if (a < b) {
            int tmp = a;
            a = b;
            b = tmp;
        }

        int gcd = get_gcd(a,b);

        int lcm = a * b / gcd;
        cout << gcd << " " << lcm << endl;

    }
    return 0;
}