Long, long ago there was a monster lived in Adventure Castle of Magic.
One day he saw that the prince Infante Concord and his wife Princess
Charm were living so sweet a life. Couldn't help becoming jealous, he
used his powerful magic to turn the prince to an ugly frog. The brave
and smart princess made up her mind to rescue her husband. After
overcomed thousands of difficulties and challenges, she finally arrived
at the Adventure Castle of Magic. When she saw her dearest handsome
husband had become an ugly and awful frog by the curse of the monster,
her heart almost broken. The monster gave her a very hard puzzle as a
condition to exchange the prince. The princess was required to choose
the right ones from some given ropes. A right rope means that the rope
wouldn't make a knot by pulling up its two ends. If the princess chose
all the right ones, the curse would disappear and the price would be
rescued, otherwise he would be strangled to death. In order to rescue
her husband, without hesitation, the princess accepted the challenge.
Here are two example ropes. Figure_1 is a right rope while Figure_2 is
not a right rope: