Start by climbing up.
Once you are up, what direction can you go?
Down, obviously . . . and port.
I hope you saved the game?
There is another interesting thing you can do while you are up the mast.
You can hold the flag.