A topological puzzle

Suppose you have a painting that you want to put on a wall. You have two nails and a string. How would you arrange the string and the nails so that by removing anyone of the two nails the painting would fall on the ground instead of hanging on to the other nail?

Well, like this:

That is, we use the fact that $\pi_1(\mathbb{R}^2\backslash\{a,b\})$ is not commutative. Obviously I didn’t come up with this puzzle myself as I have no knowledge of topology, I found it here. Maybe it’s well-known actually…