Want to travel ?

Problem statement

Imagine that someone has scheduled for you several flights but he did not write them in order. Here is an example:

Each airport is identified by its code (BOD is for example the airport of Bordeaux). Each flight is composed of a departure airport and a destination airport. For example, for the first flight of the list, the departure airport is BES (Brest) and the destination airport is BOD (Bordeaux). If you follow these flights in order, you will see that it is impossible (unless you have a fast car to quickly go to the next airport or you can go by teleportation... but wait why do you want to take the plane then ?). What we are sure is that it exists an unique order where it is possible for the traveller to visit all the airports. In this example, the right order of the flights is the following: This order is better right ? Indeed, each time I get to a new airport, my next flight leaves from this airport and I visit all the airports.
This is exactly the goal of our algorithm. It is true that here you can do it manually, but imagine thousands of flights...
For this algorithm, the requirements are the following: As usual, before delving into the solution, I invite you to think how to do it by yourself (it is the funniest part ;)).