#!/usr/bin/env python3
import itertools

aa,bb,cc,vol = map(int, input().split())

a,b,c = sorted([aa,bb,cc])
while 6*a*b*(c-1) >= vol:
    c -= 1
    a,b,c = sorted([a,b,c])

vertices = [(0,0,0),(a,b,0),(a,0,c),(0,b,c)]

def cut_corner(x,y,z,u,v,w):
    global vertices
    vertices.append((u if x == 0 else x-u, y, z))
    vertices.append((x, v if y == 0 else y-v, z))
    vertices.append((x, y, w if z == 0 else z-w))

rem = 6*a*b*c - vol

if c >= 6:
    cut_corner(a,0,0,rem%a,1,1)
    rem //= a
    cut_corner(0,b,0,a,rem%b,1)
    rem //= b
    cut_corner(0,0,c,a,b,rem)
    vertices.append((a,b,c))
else:
    cuts = dict([(x*y*z,(x,y,z)) for x in range(a+1) for y in range(b+1) for z in range(c+1)])
    found = False
    for p,q,r,s in itertools.combinations_with_replacement(cuts.keys(), 4):
        if p+q+r+s == rem:
            u,v,w = cuts[p]
            cut_corner(a,0,0,u,v,w)
            u,v,w = cuts[q]
            cut_corner(0,b,0,u,v,w)
            u,v,w = cuts[r]
            cut_corner(0,0,c,u,v,w)
            u,v,w = cuts[s]
            cut_corner(a,b,c,u,v,w)
            found = True
            break

    if not found:
        if (a,b,c,vol) == (1,1,1,1):
            vertices = [(0,0,0),(0,0,1),(0,1,0),(1,0,0)]
        elif (a,b,c,vol) == (2,2,2,25):
            vertices = [(1,0,0),(0,1,0),(1,1,0),(0,0,1),(0,2,1),(2,0,1),(2,2,1),(0,0,2),(2,0,2)]
        else:
            assert False

vertices = set(vertices)
print(len(vertices))
for i,j,k in itertools.permutations([0,1,2]):
    if all(map(lambda p: p[i] <= aa and p[j] <= bb and p[k] <= cc, vertices)):
        for p in vertices:
            print(p[i],p[j],p[k])
        break
