Isguros is right. If you are unable to solve the puzzle (which should be easily doable, if you make a note of everything you're told), you can buy the individual pieces from each NPC instead, or even buy the whole surfboard. However, you will need to acquire enough Pokédollars to do so. This is the only other alternative.