On the Synthesis of Choreographies