Go: package main

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

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

func main() {
	sc.Split(bufio.ScanLines)
	defer out.Flush()

	for sc.Scan() {
		x, y := nextInts()
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		fmt.Fprintf(out, "%d %d\n", y, lcm/y)
	}

}

func nextInts() (a, b int) {
	s := strings.Split(sc.Text(), " ")
	ra, _ := strconv.Atoi(s[0])
	rb, _ := strconv.Atoi(s[1])
	a = ra
	b = rb
	return
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<int(n);++i)

ll a,b;
ll tmp;

ll gcd(ll a,ll b){
	if((0==a)||(0==b)) return 0;
	
	while(a!=0&&b!=0){
		if(a>b) a %= b;
		else b %= a;
	}
	return a==0?b:a;
}

ll lcm(ll a,ll b){
	if((a==0)||(b==0)) return 0;
	
	return ((a/tmp) * b);
}

int main(){
	while(cin>>a>>b){
		tmp = gcd(a,b);
		cout<<tmp<<" "<<lcm(a,b)<<endl;
	}
	return 0;
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
int main(void) {
    while (1) {
        ll a, b, A, B;
        cin >> a >> b;
        A = a; B = b;
        if (a < b) swap(a, b);
        ll r = b;
        while (r) {
            r = a % b;
            a = b;
            b = r;
        }
        cout << a << " " << (A/a) * B << endl;
    }
    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	long long int a = 0,b = 0;
	long long int ans1 = 0,ans2 = 0,hozon = 0;
	long long int cnt1 = 2,cnt2 = 2;

	while (scanf("%lld %lld",&a,&b) != EOF)
	{
		cnt1 = 2;
		cnt2 = 2;
		if (a == b)
		{
			ans1 = a;
			ans2 = a;
		}
		else if (a % b == 0)
		{
			ans1 = b;
			ans2 = a;
		}
		else if (b % a == 0)
		{
			ans1 = a;
			ans2 = b;
		}
		else
		{
			ans1 = a;
			ans2 = b;
			if (ans1 < ans2)
			{
				hozon = ans1;
			}
			else
			{
				hozon = ans2;
			}
			while (1)
			{
				if (a % hozon == 0 && b % hozon == 0)
				{
					break;
				}
				hozon -= 2;
			}
			while (1)
			{
				while (ans1 < ans2)
				{
					ans1 = a * cnt1;
					cnt1++;
				}
				while (ans2 < ans1)
				{
					ans2 = b * cnt2;
					cnt2++;
				}
				if (ans1 == ans2)
				{
					break;
				}
			}
		}
		printf("%lld %lld\n",hozon,ans2);
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long int a = 0;
	long long int b = 0;
	long long int c = 0;
	long long int d = 0;
	long long int e = 0;
	cin >> a;
	cin >> b;
	c = a;
	d = b;
	if (c < d)
	{
		long long int i = 0;
		i = d;
		d = c;
		c = i;
	}
	while (1)
	{
		e = c % d;
		if (e == 0)
		{
			break;
		}
		c = d;
		d = e;
	}
	cout << d << " " << a / d * b << endl;

	return 0;
}

C++: #include<iostream>

int main(){
	int x,y;
	std::cin>>x>>y;
	
	for(int i=x;i>0;++i){
		if(i%x==0&&i%y==0){
			std::cout<<i<<' ';
			break;
		}
	}

	for(int j=x;j>0;--j){
		if(x%j==0&&y%j==0){
			std::cout<<j<<std::endl;
			break;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
long long solve(long long a,long long b){
    int w,max=a,min=b;
    if(a<b){
        max=b;
        min=a;
    }
    while(max%min!=0){
        max-=min;
        if(max<min){
          w=min;
          min=max;
          max=w;
        }
    }
    return min;
}
int main(void){
    long long a,b;
    while(cin>>a>>b){
        cout<<solve(a,b)<<" "<<a*b/solve(a,b)<<endl;
    }
    return 0;
}

C++: long long gcd(long long m, long long n){

	if(m<n){
		long long swap;
		swap = m;
		m = n;
		n = swap;
	}

	do {
		if(n==0){
			return m;
		}
		
		int swap = m % n;
		m = n;
		n = swap;
	} while(1);
}


int main(){
//	m*n = LCM * GCD
	long long m, n;
	while(cin >> m >> n){
		long long  LCM, GCD;
		
		GCD = gcd(m, n);
		LCM = (m*n)/GCD;
		cout << GCD << " " << LCM << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
   int a,b;
 while(scanf("%d %d",&a,&b)==2){
  for(int i = a; i>0;i--){
    if(a%i== 0&& b%i == 0){
     printf("%d %d",i,a*b/i);
		break;
    }

 }
 }
    return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
long long int a, b;
long long int gcd()
{
	long long int min = a,other=b;
	if (b < a){
		min = b; other = a;
	}
	int i;
	for (i = 1; i <= sqrt(long double(min)); i++)
	{
		if (min%i == 0)
		{
			if (other % (min / i) == 0)
				return min / i;
		
		}
	}
	for (i = sqrt(long double(min)); i >= 1; i--)
	{
		if (min%i == 0)
		{
			if (other %  i == 0)
				return i;
	     }
		
	}
}
int main()
{
	while (scanf("%lld %lld",&a,&b)==2)
	{
		long long int g = gcd();
		printf("%lld ", g);
		printf("%lld\n", (a / g)*(b / g)*g);
	}
}

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

template<class T> T gcd(T a, T b) {
	return b ? gcd(b, a%b) : a;
}
template<class T> T lcm(T a, T b) {
	return a*b / gcd(a, b);
}

int main(int argc, char** argv) {
	unsigned long long a, b;
	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
long long int g_c_d(long long int a,long long int b);
int main()
{
    long long int lcm,gcd,a,b,product;
    while(scanf("%lld %lld",&a,&b)==2)
    {
        gcd=g_c_d(a,b);
        product=a*b;
        lcm=product/gcd;
        printf("%lld %lld\n",gcd,lcm);
    }
    return(0);
}
long long int g_c_d(long long int a,long long int b)
{
    long long int r;
    if((a%b)==0)
    {
        return(b);
    }
    else
    {
        r=a%b;
        return(g_c_d(b,r));
    }
}

C++: //{Headers
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<algorithm>
#include<list>
#include<queue>
#include<deque>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<bitset>

using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > pii;
#define mp(x,y) make_pair(x,y)
typedef long long ll;
//}

int a,b;

int GCD(int a,int b){return b==0?a:GCD(b,a%b);}

void solve(){
    int gcd=GCD(a,b);
    int lcm=a/gcd*b;
    printf("%d %d\n",gcd,lcm);
}

int main(void){
//    freopen("in.txt","r",stdin);
    while(~scanf("%d%d",&a,&b))
        solve();
    return 0;
}

/*
8 6
50000000 30000000
*/

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

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();}

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

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