#!/usr/bin/env python3

a,b,c,v = (int(i) for i in input().split())
res = set()
while 6*(a-1)*b*c >= v: a -= 1
while 6*a*(b-1)*c >= v: b -= 1
while 6*a*b*(c-1) >= v: c -= 1

w = 6*a*b*c-v
if w == 0:
	a0, b0, c0 = (0, 0, 0)
else:
	a0 = min(a, w)
	b0 = min(b, w//a0)
	c0 = min(c, w//a0//b0)
w -= a0*b0*c0

if w == 0:
	a1, b1, c1 = (0, 0, 0)
else:
	a1 = min(a, w)
	b1 = min(b, w//a1)
	c1 = min(c, w//a1//b1)
w -= a1*b1*c1

if w == 0:
	a2, b2, c2 = (0, 0, 0)
else:
	a2 = min(a, w)
	b2 = min(b, w//a2)
	c2 = min(c, w//a2//b2)
w -= a2*b2*c2

if w == 0:
	a3, b3, c3 = (0, 0, 0)
else:
	a3 = min(a, w)
	b3 = min(b, w//a3)
	c3 = min(c, w//a3//b3)
w -= a3*b3*c3

if w == 0:
	res = {(a,0,0), (0,b,0), (0,0,c), (a,b,c),
			(a0, 0, 0), (0, b0, 0), (0, 0, c0),
			(a1, b, c), (0, b-b1, c), (0, b, c-c1),
			(a-a2, 0, c), (a, b2, c), (a, 0, c-c2),
			(a-a3, b, 0), (a, b-b3, 0), (a, b, c3)}
elif a == 2 and b == 2 and c == 2 and v == 25:
	res = {(0, 0, 0), (0, 0, 1), (0, 1, 1), (0, 2, 0), (1, 0, 2), (1, 2, 0),
			(1, 0, 0), (1, 2, 2), (2, 2, 2)}
elif a == 1 and b == 1 and c == 1 and v == 1:
	res = {(0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)}

print(len(res))
for r in res:
	print(r[0], r[1], r[2])
