#include <iostream>
#include <string>
#include <vector>
#include <sstream>

using namespace std;
using DataSet = vector<double>;

void readInputData(vector<string> input_data){
    string buff;
    while(getline(cin, buff)){
        input_data.push_back(buff);
    }
}

void _parseString(const string& input_data, DataSet& data_set) {
    data_set.resize(6);

    stringstream ss;
    ss << input_data;
    ss >> data_set[0] >> data_set[1] >> data_set[2]
        >> data_set[3] >> data_set[4] >> data_set[5];
}

void parseString(const vector<string>& input_data, vector<DataSet>& data_set) {
    for(int i = 0; i < input_data.size(); ++i) {
        DataSet buff;
        _parseString(input_data[i], buff);
        data_set[i] = buff;
    }
}

double determinant2d(const DataSet& data){
    return data[0] * data[4] - data[1] * data[3];
}

void inverse2d(DataSet& data){
    double det = determinant2d(data);

    double t = data[0];
    data[0] = data[4];
    data[4] = t;

    data[1] = -data[1];
    data[3] = -data[3];

    data[0] /= det;
    data[1] /= det;
    data[3] /= det;
    data[4] /= det;
}


void calculateXY(const DataSet& data, vector<double>& result){
    result.resize(2);
    result[0] = data[0] * data[2] + data[1] * data[5];
    result[1] = data[3] * data[2] + data[4] * data[5];
}

void solve(vector<DataSet>& data_set){
    for(int i = 0; i < data_set.size(); ++i){
        vector<double> buff;

        inverse2d(data_set[i]);

        calculateXY(data_set[i], buff);

        cout << buff[0] << " " << buff[1] << endl;
    }
}


void doAllProcess(){
    vector<string> input_data;
    readInputData(input_data);

    vector<DataSet> data_set;
    parseString(input_data, data_set);
    
    solve(data_set);
}

int main(){
    doAllProcess();

    return 0;
}
