Each player starts from the point that the other player selects. Here's an explanation for the 2nd test
1 / \ 2 3 / \ / \ 4 5 6 7 - + + 0
If the first player chooses the 2 node, the second player will choose the 4th and win. If the first player chooses the 3 node, the second player will choose the 7th node (he prefers to draw than to loose)
So, the player will choose the 3rd node, as he prefers drawing rather than loosing.