#include <cstdio>

#define MAX(a, b)((a) < (b) ? (b) : (a))
#define MIN(a, b)((a) < (b) ? (a) : (b))

using namespace std;

int LCM(int x, int y)
{
    int bigger = MAX(x, y);
    int smaller = MIN(x, y);
    int i = 2;
    int j = 2;
    
    if ((smaller * i) % bigger == 0) return bigger;
    
    while ((smaller * i) % bigger != 0) {
        if (bigger < (smaller * i)) {
            bigger *= j;
            
            j++;
        }
        
        i++;
    }
    
    return bigger;
}

int main() {
	int a, b, c, d, e, f;
	int _a, _b, _c, _d, _e, _f;
	double x, y;
	int _x, _y, _z;
	int multiTop, multiBottom;
	int common;
	
	while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) {
	    common = LCM(a, d);
	    multiTop = common / a;
	    multiBottom = common / d;
	    
	    _a = common;
	    _b = b * multiTop;
	    _c = c * multiTop;
	    
	    _d = common;
	    _e = e * -multiBottom;
	    _f = f * -multiBottom;
	    
	    _y = _b + _e;
	    _z = _c + _f;
	    
	    y = (double)_z / (double)_y;
	    
	    _c = c - (b * y);
	    
	    x = (double)_c / (double)a;
	    
	    printf("%.3f %.3f\n", x, y);
	}
	
	return 0;
}