for x in range(1,100//5): for y in range(1,100//3): for z in range(100): if x + y + z == 100 and 5*x + 3*y + z/3 ==100 : print(x,y,z)