from itertools import permutations print sorted(set([sum(x) for x in permutations([1,1,1 ,5,10,10,10,50,100,100,100,500], 3)]))
Standard input is empty
[3, 7, 12, 16, 21, 25, 30, 52, 56, 61, 65, 70, 102, 106, 111, 115, 120, 151, 155, 160, 201, 205, 210, 250, 300, 502, 506, 511, 515, 520, 551, 555, 560, 601, 605, 610, 650, 700]