#include<cstdio>
double a,b,c,d,e,f;
void C(double *p,double *q)
{
    double t=*p;
    *p=*q;
    *q=t;
}
int main()
{
    while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)==6)
    {
        if(a==0)
        {
            C(&a,&d);
            C(&b,&e);
            C(&c,&f);
        }
        double x,y=(f-d*c/a)/(e-b*d/a);
        x=c/a-b*y/a;
        printf("%.3lf %.3lf\n",x,y);
    }
    return 0;
}