# square
# Fig 63.2
# info: "Riddles of the Sphinx": Q.29 Hustle off to Buffalo, first answer, p.105
# inputs: 1 5 10 22  or 1 5 25 125
# 1 1.839286755 3.382975769 6.222262522

a,b,c,d = map(float, input("a b c d=? ").split())
count = 0
while (a+b+c+d) != 0:
  a1 = abs(a-b)
  b1 = abs(b-c)
  c1 = abs(c-d)
  d1 = abs(d-a)
  a = a1; b = b1
  c = c1; d = d1
  count += 1
  print(f"{a:10.5f} {b:10.5f} {c:10.5f} {d:10.5f}")
print("count =", count)
