L293B motor driver flyback diodes

Hi, I am newbie I found out that my driver has no flyback diodes in discussion on this forum. So I downloaded datasheets of both driver L293B and L293D, but they both have diodes on the Functional Block Diagram.

I bought 1N4007 diodes. Could someone share the schematic how should I connect them properly in case I have two motors. The first connected to the pins 3 and 6, and the second one to the pins 11 and 14.

I would be grateful for any help. Also please explain the purpose of these diodes.

Thanks

Top diagram, page 2 from this datasheet: http://www.st.com/content/ccc/resource/technical/document/datasheet/3f/2a/59/15/61/43/45/af/CD00000058.pdf/files/CD00000058.pdf/jcr:content/translations/en.CD00000058.pdf

Thanks for the answer, so if I need only one direction rotation I can use only one diode as shown at the top right corner motor ?

Yes.

Thanks for the answer, could you please explain the purpose of these diodes ?

Motors are inductive loads.