import math a,b,c,d,e,f=map(int,input().split()) numad=a*d//math.gcd(a,d) y=((c*(numad//a))-(f*(numad//d)))/((b*(numad//a))-(e*(numad//d))) x=(c-(b*y))/a print(x,y)