import sys
a,b,c,d,e,f = map(int, sys.stdin.readline().split())
for x in range(-999, 1000):
for y in range(-999, 1000):
if a*x + b*y == c and d*x + e*y == f:
print(x,y)
break
위 조건을 따지면 x,y 는 범위가 정해져 있기에 모든 x,y 의 경우를 확인하는 방법을 사용하면 된다.