#include<iostream>

int main()
{
	int a, b, c, d, e, f;
	std::cin >> a >> b >> c >> d >> e >> f;
	int det = b * d - a * e;
	std::cout << ( b * f - c * e ) / det << std::endl;
	std::cout << ( c * d - a * f ) / det << std::endl;

 	return 0;
}