1if __name__ == '__main__':
2 x = int(input())+1
3 y = int(input())+1
4 z = int(input())+1
5 n = int(input())
6 variable = []
7 for i in range(0,x):
8 for j in range(0,y):
9 for k in range(0,z):
10 if ( i+j+k) != n:
11 variable.append([i, j, k])
12print(variable)