from itertools import*
f=lambda d,t,l:[i+d for i in combinations_with_replacement(d,l-len(d))if sum(i+d)==t]

print(f((1,2,3),36,15))