Rubik's Snake

Twist and rotate the snake to create the given shapes. It's trickier than it seems.