Chloe and Tim were looking for a treasure, left by some algorithms lover, for a long time. Finally, they found the last riddle that separated them from their goal. The riddle was the following:
"Go to the city, which number on the list is the number of the root of the SCC that will be found the third during the Tarjan’s algorithm.
Note: during DFS, visit the children with the lesser numbers first: for example, if a node has children with the numbers 3 and 4, first visit the node with the number 3, then the node with the number 4. Start the DFS from the node 1".
It was followed by the list of cities with numbers:
- Moscow
- Athens
- Bologna
- London
- Paris
- Berlin
- Seoul
- Vienna
Look at the graph and help them find the needed city. They may even share their newfound riches with you later on!