while 1:
s = input()
if not s:break
c = eval(s.replace('x','*x').replace("=","-(") + ")",{'x':1j})
print(-c.real / c.imag)
while 1:
s = input()
if not s:break
c = eval(s.replace('x','*x').replace("=","-(") + ")",{'x':1j})
print(-c.real / c.imag)