import sys

sys.stdin = open("equation.in", "r")
sys.stdout = open("equation.out", "w")

x,y,z,k = map(int, input().split())

if x*x*x + y*y + z == k:
    print(x,y,z)
elif x*x*x + z*z + y == k:
    print(x,z,y)
elif y*y*y + x*x + z == k:
    print(y,x,z)
elif y*y*y + z*z + x == k:
    print(y,z,x)
elif z*z*z + y*y +  x == k:
    print(z,y,x)
elif z*z*z + x*x + y == k:
    print(z,x,y)
else:
    print(-1,-1,-1)
