I think it means this: two hearts (a relationship) can end happily on it's own. Add a third person in to the mix, and does the situation ever end well without someone getting hurt? No. I think the title is saying, there are 3 people in the situation, and if he could wave a magic wand and have a machine that creates "happy endings" from whatever you put in to it, it would all end favorably.
but that's just my speculation. who knows what he was thinking?!